I noticed that although the plugin replaces WordPress’ built in wp_mail() function, it doesn’t call the ‘wp_mail’ filter.
So if you have a plugin or code in, for example, functions.php, that filters outgoing email to say, change an email address or add/remove a recipient, it no longer gets the chance to run.
Please could you add in a call to apply_filters() in wpmandrill.php in wpMandrill::mail() just inside the try block:
extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'html', 'headers', 'attachments' ) ) );
There are a bunch of other filters the plugin doesn’t call either. Again if possible, it would be good practice to call these too ‘wp_mail_from’, ‘wp_mail_from_name’, ‘wp_mail_content_type’, and ‘wp_mail_charset’
Also, I notice that the current first line in that try block:
$message = compact('html', 'text', 'subject', 'from_name', 'from_email', 'to', 'headers', 'attachments', ...
references a variable ‘text’ that doesn’t exist.
- The topic ‘wp_mail filter isn't called’ is closed to new replies.