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):
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/