Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/palmtreephp/wp-mailer
Small OOP wrapper around WordPress' wp_mail function
https://github.com/palmtreephp/wp-mailer
Last synced: about 1 month ago
JSON representation
Small OOP wrapper around WordPress' wp_mail function
- Host: GitHub
- URL: https://github.com/palmtreephp/wp-mailer
- Owner: palmtreephp
- License: mit
- Created: 2019-03-04T20:58:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T20:59:08.000Z (almost 6 years ago)
- Last Synced: 2024-04-19T16:41:39.290Z (8 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :palm_tree: WordPress Mailer
[![License](http://img.shields.io/packagist/l/palmtree/wp-mailer.svg)](LICENSE)
[![Travis](https://img.shields.io/travis/palmtreephp/wp-mailer.svg)](https://travis-ci.org/palmtreephp/wp-mailer)Small OOP wrapper around `wp_mail()`.
## Requirements
* PHP >= 5.6## Installation
Use composer to add the package to your dependencies:
```bash
composer require palmtree/wp-mailer
```Create the Mailer service, usually using a DI container:
```php
setSubject('Hello!')
->setBody('Hey, this is an HTML email!
')
->addCc('[email protected]')
->addBcc('[email protected]');$message->attach('/path/to/some/file.pdf');
if ($mailer->send($message)) {
echo 'Sent!';
} else {
echo 'Error sending';
}
```## License
Released under the [MIT license](LICENSE)