How To Exclude Contact Form 7 mail from Mandrill? (4 posts)

  1. abelljefrry
    Posted 2 years ago #

    Hello WPMandrill team,

    Can I exclude Contact Form 7 mails from going through Mandrill?

    Because I use CF7 as a Zendesk 'dropbox'. Plus, I also use email forwarding service for my Zendesk. (support@mydomain.com to support@mydomain.zendesk.com)

    This setup really hurt my open rate. Any idea how to exclude Contact Form 7 from going through Mandrill?

    Thanks in advance.


  2. MC_Will
    Plugin Author

    Posted 2 years ago #

    Hi abelljefrry,

    You can exclude any email using the mandrill_payload filter.

    Once you have identified CF7 emails, probably by checking the automatic tags, just add a field called force_native to the $message received and set it to true.

  3. abelljefrry
    Posted 2 years ago #

    I'm not really good at writing codes. May I know the code to add that particular field into my $message?

    Thanks in advance. :)

  4. MC_Will
    Plugin Author

    Posted 2 years ago #


    I don't know the exact tags CF7 is using but the general template should look like this:

    public function excludeCF7($message) {
        $cf7_tag = 'cf7_actual_tag'; //Replace with actual tag used by CF7
        if ( in_array($cf7_tag, $message['tags']['automatic']) ) {
            $message['force_native'] = true;
        return $message;
    add_filter('mandrill_payload', 'excludeCF7');

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • wpMandrill
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic