mailgun / wordpress-plugin

Mailgun's Wordpress Plugin
GNU General Public License v2.0
48 stars 53 forks source link

Empty tag added to headers #51

Closed pirogoeth closed 7 years ago

pirogoeth commented 7 years ago

If the user doesn’t specify a tag in the configuration page, Mailgun creates a single tag with an empty string value, instead of leaving the tags array empty. This causes problems when you need to allow users to unsubscribe based on X-Mailgun-Tag headers that have been programatically added outside of the plugin.

It doesn’t look as if the current behaviour is intended. The following fixes the problem in v1.5.8.1 of the plugin (includes/wp-mail-api.php):

Line 229, change this:

$body['o:tag'] = '';

to this:

$body['o:tag'] = array();

and on line 240, change this:

if (isset($mailgun['campaign-id'])) {

to this:

if (!empty($mailgun['campaign-id'])) {


Source: https://wordpress.org/support/topic/comment-notification-email-are-not-being-sent/

pirogoeth commented 7 years ago

Completed in #52