WordPress.org

Ready to get started?Download WordPress

Forums

wpMandrill
Mandrill and easyReservations (3 posts)

  1. tstruyf
    Member
    Posted 1 year ago #

    Hi,

    I'm unable to send mails using Maildrill and the EasyReservation plugin:
    http://wordpress.org/extend/plugins/easyreservations/

    I configured Mandrill using an API key. It seems to work just fine for WordPress actions. Emails (like new user registration) are sent succesfully via mail270.us4.mandrillapp.com (vissible in Gmail).

    easyReservations sends mails using the wp_mail function. (lib/classes/reservation.class.php line 949) I was excepting Mandrill would step in and take over sending-process. Instead, the mail is sent via my own webserver. No errors are shown. (Just like when Mandrill-plugin would not be active)

    I'm using a fresh install of WP3.5, Only easyReservation and Mandrill activated. I did install Contact form 7, to test a 3-party plugin. This worked fine. CF7 now deactivated.

    Since this is probably no really a Mandrill-issue, I can only ask for:
    A. Is anyone using Mandrill and easyReservation? Working fine?
    B. How can I debug this problem? Where do I start looking?

    Any help is welcome!
    Thx!

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

  2. MC_Will
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Sorry for the delay!

    EasyReservations seems to be adding some headers that might not be recognized by Mandrill:
    http://plugins.trac.wordpress.org/browser/easyreservations/trunk/lib/classes/reservation.class.php#L943

    In that case, wpMandrill defaults to the regular wp_mail function.

    You should be able to modify their request on-the-fly by using the wordpress filter 'mandrill_payload'.

  3. tstruyf
    Member
    Posted 1 year ago #

    I tried adding this in my themes fucntions.php:

    /* WP MANDRILL FILTER */
    add_filter('mandrill_payload','mandrill_add_reply_to');
    function mandrill_add_reply_to($message) {
       // die('test');
        $message['headers']['Reply-To'] = $message['from_email'];
        $message['from_name'] = 'My test';
        $message['from_email']= 'info@myregistereddomain.be';
        return $message;
    }

    The mails are still sent via my server. Nothing changes, No errors are shown. (Checked php-logs) I know the function mandrill_add_reply_to() is being called, because uncommenting die() works.

    I solved this hardcoded by manualy replacing the wp_mail call in the plugin:

    //$mail = @wp_mail($to,$subj,$msg,$headers, $attachment);
    $mail = wp_mail($to,$subj,$msg,'From: My test <info@myregistereddomain.be>');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic