https://github.com/biohzrdmx/wp-mandrill-mailer
Send transactional email using Mandrill easily and without hassle
https://github.com/biohzrdmx/wp-mandrill-mailer
email-sender mandrill-api plugin wordpress
Last synced: about 1 year ago
JSON representation
Send transactional email using Mandrill easily and without hassle
- Host: GitHub
- URL: https://github.com/biohzrdmx/wp-mandrill-mailer
- Owner: biohzrdmx
- License: mit
- Created: 2019-12-04T18:31:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-27T19:35:37.000Z (over 5 years ago)
- Last Synced: 2025-01-28T16:17:21.819Z (over 1 year ago)
- Topics: email-sender, mandrill-api, plugin, wordpress
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wp-mandrill-mailer
Send transactional email using Mandrill easily and without hassle
## Requirements
- WordPress 5.x
- PHP 5.3+
- [Mandrill PHP SDK](https://bitbucket.org/mailchimp/mandrill-api-php/src/master/)
## Installation
Download and unzip into a subfolder of your `wp-content/plugins` folder.
Make sure the folder name is `wp-mandrill-mailer`.
Inside that folder you'll find the `lib` folder. Place the contents of the `src` folder from the Mandrill PHP SDK inside it. You should have both `Mandrill.php` and a `Mandrill` folder directly inside `lib`.
Then get the `cacert.pem` file from [this page](https://curl.haxx.se/docs/caextract.html) and upload to the root of the `wp-mandrill-mailer` folder on your WordPress instance.
Now, in your WordPress go to the **Dashboard** and then to **Plugins**, find the **Placeholders** plugin and activate it.
Then again in the Dashboard, go to **Mandrill Mailer** and enter your API key and Pool name (you may enter `Main Pool` to use the default pool).
## Usage
First create a message using the `MandrillMessage` class
```php
# Create a MandrillMessage object and set the subject, from, to, contents, attachments, etc.
$message = MandrillMessage::newInstance()
->setSubject('Test')
->setFrom( array('test@mailinator.com' => 'Me') )
->setTo( array('test@mailinator.com' => 'Me') )
->setTemplate(get_template_directory() . '/templates/mailing/default.mailing.html')
->setImages(array('email_header' => get_template_directory() . '/images/mailing/header.jpg'))
->setAttachments(array('Test.pdf' => get_template_directory() . '/files/test.pdf'))
->setReplacements(array('%email-footer%' => 'Test'))
->setContents('
Hey you
');
```
Then just send your message:
```php
MandrillMailer::send($message);
```
The function will either return `TRUE` if the mail was sent successfully and `FALSE` otherwise.
## Licensing
MIT licensed
## Author
Author: biohzrdmx [](https://github.com/biohzrdmx)