Skip to main content
  1. All Posts/


Tools Open Source Sync WordPress
=== wpMandrill ===
Contributors: MC_Will
Tags: mandrill, mailchimp, transactional email, email, email reliability, smtp, wp_mail, email templates
Requires at least: 3.0
Tested up to: 3.8
Stable tag: trunk
License: GPLv2

The wpMandrill plugin sends emails that are generated by WordPress through Mandrill, a transactional email service powered by MailChimp.

== Description ==

This plugin uses [Mandrill API]( to send outgoing emails, with or without attachments, from your WordPress installation. It replaces the wp_mail function included with WordPress.

Emails are tracked and automatically tagged for statistics within the Mandrill Dashboard. You can also add general tags to every email sent, as well as particular tags based on selected emails defined by your requirements.

You can also use your own templates that have been added to your MailChimp account and shared with your Mandrill account.

There are a few levels of integrations between your WordPress installation and this plugin:

1. The simplest option: Install it, configure it, and wpMandrill will start sending your emails through Mandrill.
1. If you need to fine tune certain emails, you can change any email by creating a filter for the **mandrill_payload** hook.
1. For further customization, we've exposed a function that allows you to send emails from within your plugins, instead of the regular wp_mail function: **wpMandrill::mail**

This plugin is currently released as **beta** for early adopter evaluation and finalizing of the initial feature set.

Spanish translation available.

== Installation ==

1. Upload `wpMandrill` to the `/wp-content/plugins/` directory
1. Activate the plugin through the _Plugins_ menu in WordPress
1. Configure plugin in _Settings > Mandrill_

== Frequently Asked Questions ==

= Why do I need a Mandrill API key? =

In order to use this plugin, you have to provide one of your Mandrill API keys. That's currently the only way we can get access to your Mandrill account.

= Do I need a MailChimp account? =


= Are all emails routed through Mandrill? =

Yes. We try to send every single email sent through your WordPress installation. We also try to process your headers and attachments.

If the sending fails for any reason, the plugin will try to send it again using the WordPress wp_mail function.

= What if I need to send some of my emails using the native wp_mail() function?

Use the mandrill_payload filter and add a new parameter called 'force_native' to the $message variable, and set it to true:

$message['force_native'] = true;

= My emails are broken and show weird CSS code =

In version 1.09, we added a setting that allows you to tell the plugin if you want to replace your line feeds by <br/>. Try playing with that switch. 

If it works for certain emails but doesn't work for others, you might want to modify this setting using the **mandrill_nl2br** filter. For example, if you don't want to use this filter for the "forgot password" emails, add something like this to your theme's functions.php file:

function my_function($nl2br, $message) {
	if ( in_array('wp_retrieve_password', $message['tags']['automatic']) ) {
        $nl2br = false;
	return $nl2br;
add_filter('mandrill_nl2br', 'my_function');

= Is there any way to check what's going on? =

If we couldn't send your email through Mandrill, we'll try to leave the Mandrill response in your server's log so that's your first stop.

Additionaly, if you set the WP_DEBUG constant (defined in your wp-config.php file) to true, you'll see some messages added by the plugin in key parts of the process.

= I am getting an Invalid API Key message and I'm sure my API is valid!

Please verify the following:

1. That your API key is active (this can be viewed on the SMTP & API Credentials page in your Mandrill account);
1. That your web server has either cURL installed or is able to use fsock*() functions (if you don't know what this means, you may want to check with your hosting provider for more details);
1. That the domain name you're using above is listed in the Sending Domains for your Mandrill account.

== Request ==

If you find that a part of this plugin isn't working, please don't simply click the WordPress "It's broken" button. Let us know what's broken in [its support forum]( so we can make it better. Our [mind-reading device]( still needs some tweaking.

== Localizations ==
wpMandrill is currently localized in the following languages:

* Spanish (es_ES)

== Known Issues ==

* Daily statistics will show data for the first 20 senders (emails) registered.
* Daily statistics will show data for the first 40 tags registered.

If your account has more than 20 senders registered or more than 40 tags used, the detailed daily statisticas might show incompleted data.

== Screenshots ==

1. Settings screen
2. Statistics
3. Dashboard widget
4. Dashboard widget Settings

== Changelog ==
= 1.33 =
* ADDED: Logging messages to trace a bug where the stats are not getting updated 
* FIXED: Order of preference for tags.
* ADDED: Support for css inlining, recipient preservation, whether or not to have the view content link in your Mandrill dashboard, tracking, signing, and return-path domains, using subaccounts, per recipient metadata, pool of ips, email scheduling, and asynchronous sending in wpMandrill::mail(). 
* REMOVED: The concept of 'verified domains' was completely removed from the plugin.  
* ADDED: Tracking options in the settings page
* ADDED: New filter, mandrill_nl2br, that can be used to modify the value of the "Replace Line Feeds by <br>" setting, for specific messages. Check the How-To to see how it works.
* FIXED: Removing wrongly formatted attachments from the payload
= 1.32 =
* FIXED: Reordering constructors of Mandrill class to prevent the "Redefining already defined constructor" message
* UPDATE: Favoring self:: instead of wpMandrill:: 

= 1.31 =
* FIXED: Some PHP 5.3 installations don't have the finfo_open available so we're now checking for the function instead of the PHP version 

= 1.30 =
* FIXED: Multiples To: recipients where not being handling correctly. 

= 1.29 =
* ADDED: wp_mail, wp_mail_from, and wp_mail_from_name filters. ** Thanks Mike Little! **
* ADDED: Support for "important" emails.
* UPDATED: WordPress wp_mail function code.
* ADDED: wpMandrill User-Agent 
= 1.28 =
* ADDED: If you want to fall back some of your emails to the native wp_mail function, now you can do it by using the mandrill_payload filter and setting a parameter called 'force_native' to true.
* REMOVED: Mime type checking on attachments. 
* ADDED: Sending MIME TYPE of attachments to Mandrill only when wpMandrill is able to find it.  
= 1.27 =
* FIXED: Removing php short tags. ** Thanks Kailey Lampert! ** 

= 1.26 =
* UPDATED: Now Mandrill accepts any content type and so does wpMandrill.
* FIXED: Queued messages were triggering the native wp_mail function. ** Thanks Scott Connerly! ** 

= 1.25 =
* FIXED: Undefined WPDOMAIN constant in stats.php

= 1.24 =
* UPDATED: Dashboard widget shown only to those capable of manage_options
* ADDED: CURL calls doesn't verify SSL certificates anymore. ** Thanks Bruno Braga! ** 
* ADDED: Adding support for editable regions. ** Thanks dennissmolek **
* FIXED: Using a literal as the textdomain instead of a constant. ** Thanks Joost! **
* FIXED: Cleaning some unused variables. ** Thanks Joost! **
* FIXED: Removed checking of sender domain at send time.

= 1.23 =
* FIXED: JS Alerts in wrong places...

= 1.22 =
* UPDATED: Replacing Highcharts in favor of Flot
* ADD: Cron job to fetch stats 

= 1.21 =
* FIXED: Logging wrong error messages when sending emails with no attachments
* FIXED: Attachments that Mandrill doesn't support were discarded instead of sending the email (with attachment) through the native wp_mail function.
* ADDED: Added support Audio and Video file attachments.    
* FIXED: Valid Domains matching is NOT case-sensitive now.
* FIXED: Better error reporting on Dashboard widgets.
* FIXED: Validating FROM: email address after mandrill_payload has been processed.

= 1.20 =
* ADDED: Mandrill's Privacy Policy and Terms of Use
* FIXED: Sending more than one attachment was failing
* FIXED: Doing a Ping call only when displaying the API Key on the settings page
* ADDED: Support for Global Merge Vars, Per-Recipient Merge Vars, Google Analytics, and Meta Data in wpMandrill::mail()
* FIXED: Logging error messages even if WP_DEBUG is false.

= 1.12 =
* FIXED: Issue with the CSS declaration of the RSS icon displayed on the settings page. ** Thanks Nicholas Ciske! **
* FIXED: Highcharts' Exporting module not loaded for dashboard widget
* FIXED: Removing unnecessary pings to and instanciating the API client on demand ** Thanks Per Wiklander! **

= 1.11 =
* ADDED: screenshot-4.jpg
* FIXED: Emails delivered % in Mandrill stats
* ADDED: Limiting the numbers of senders that the Mandrill stats reports.
* FIXED: Limiting the numbers of days to 30 in Daily Sending Volume graph in Mandrill stats reports.
* ADDED: Visual notification in the dashboard widget while loading.
* ADDED: Support for sockets when CURL is not present.

= 1.10 =
* ADDED: Blank .po file for other translations :)
* ADDED: Some debugging messages just in case need arises.
* ADDED: Adding GNU license
* ADDED: Mandrill's blog RSS

= 1.09 =
* ADDED: Reply-To Setting
* ADDED: Replacing line feed by <br> setting.

= 1.08 =
* FIXED: Wrong references to self:: in wp_mail introduce in 1.04 :(

= 1.07 =
* FIXED: Removing notices in the dashboard widget when there's no open or click data in the last 7 days.
* FIXED: No having general tags defined were causing a validation error. ** Thanks Max Rice! **
* FIXED: Daily stats showing some hourly stats.
* UPDATED: Spanish translation updated.
* FIXED: Speeding dashboard widget results.

= 1.06 =
* FIXED: Some installations were reporting valid API keys as invalid due to a restrictive server configuration regarding Time-Out.

= 1.05 =
* FIXED: Contextual help tab getting open in all admin pages when plugin was not configured correctly.
* FIXED: Some references to verified domains. All domains are now verified in Mandrill.
* FIXED: Mandrill Class was returning Exceptions in two places (not throwing them).

= 1.03 =
* FIXED: Test email were using an old function.
* FIXED: Some data type checking to avoid PHP warnings.

= 1.02 =
* FIXED: Dashboard widget title was displaying incorrectly when a filter was defined.

= 1.01 =
* REMOVED: How-To Plugin
* ADDED: How-To page

= 1.0 =
* Public release