WordPress.org

Ready to get started?Download WordPress

Forums

wpMandrill
[resolved] wp_mail filter isn't called (2 posts)

  1. Mike Little
    Member
    Posted 11 months ago #

    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.

    Cheers,

    Mike

    http://wordpress.org/extend/plugins/wpmandrill/

  2. MC_Will
    Member
    Plugin Author

    Posted 11 months ago #

    Thanks a lot for your help Mike.

    We'll adding those filters in the next release.

Reply

You must log in to post.

About this Plugin

About this Topic