=== Send Emails with Mandrill ===
Contributors: MillerMediaNow, mikemm01, MC_Will, MC_Amanda, cornelraiu-1, crstauf, bizmatebiz, andrewhilson, anthonywnz, srumery, ronald2020, ilanio, sanderteirlynck
Tags: mandrill, mailchimp, email, smtp, wp_mail
Requires PHP: 7.0
Requires at least: 3.0
Tested up to: 6.6.1
Stable tag: 1.4.3
License: GPLv2

'Send Emails with Mandrill' sends emails that are generated by WordPress through Mandrill, a transactional email service powered by MailChimp.

== Description ==

**Did you find this plugin helpful?** Please consider [leaving a 5-star review](https://wordpress.org/support/view/plugin-reviews/send-emails-with-mandrill/).

Note: This is a forked version of the now unsupported <a href="https://wordpress.org/plugins/wpmandrill/">wpMandrill</a> plugin. The notes below are copied over from the original plugin and will be updated as relevant updates become available. Please help by contributing to the GitHub repository [Send Emails With Mandrill on GitHub](https://github.com/Miller-Media/send-emails-with-mandrill)

This plugin uses [Mandrill API](http://mandrillapp.com/api/docs/) 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 Send Emails with Mandrill 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**

Enable the connection by entering a valid API key in the settings page or adding the line `define('SEWM_API_KEY', '{YOUR_API_KEY}')` your site's wp-config.php file.

Spanish translation available.

== Installation ==

1. Upload `Send Emails with Mandrill` 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? =

Yes. If you aren't currently on a MailChimp Monthly Plan, you'll first need to upgrade or switch to a Monthly Plan. Once you have upgraded you can follow the steps [here](https://mailchimp.com/help/add-or-remove-mandrill/) to add Mandrill to your 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.

Additionally, 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);
2. 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);
3. 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](https://wordpress.org/support/plugin/send-emails-with-mandrill/) so we can make it better. Our [mind-reading device](http://www.youtube.com/watch?v=cCTlonSwePs) still needs some tweaking.

== Localizations ==
Send Emails with Mandrill 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.4 =
* Added action hook for monitoring Mandrill API response
* Added nonce to stats AJAX call

= 1.3.1 =
* Check for error messages parameters before processing (was throwing an error)

= 1.3 =
* Added setting to turn off Dashboard Widget
* Added ability to manually fetch new data from Reports screen
* Added ability to define API key as SEWM_API_KEY in wp-config.php file
* Minor error handling adjustments

= 1.2.13 =
* Setting to disable <br /> setting for WooCommerce emails due to layout issues from recent WooCommerce updates

= 1.2.12 =
* Updates to deprecated jQuery functions

= 1.2.9 =
* Removed deprecated contextual_help() function and added add_help_tab()

= 1.2.8 =
* Add wpmandrill_enable_reports and wpmandrill_enable_widgets filters to programmatically disable the reports dashboard and widget if desired.

= 1.2.7 =
* Removed code added for previous Mandrill outage

= 1.2.6 =
* Updated messaging on how to handle the upcoming Mandrill outage
* Bug fix for memcache overload when loading Mandrill reports page on high traffic sites

= 1.2.5 =
* Updated plugin screenshots for WordPress repository
* Added support/setting for Mandrill subaccount
* Removed discontinued Mandrill API endpoint support (URL tracking)

= 1.2.4 =
* Removed RSS Feeds due to WordPress core bugs (SimplePie library)
* CSS adjustments
* Fixed false negatives when used in conjunction with Contact Form 7 and other mail sending programs

= 1.2.3 =
* Fixed WooCommerce checkout issue (class scope bug)

= 1.2.2 =
* More detailed error logging for failed e-mails
* Added email formatting to include 'name'

= 1.2.1 =
* PHP warning fix

= 1.2 =
* Added ability to override wp_mail_native function with a WordPress action
* 404 console fixes
* Various undefined variable fixes

= 1.1 =
* Added support for PHP 7.2
* Removed support for PHP < 5.6
* Added plugin activation compatibility checks

= 1.0 =
* Initial release

