Support » Plugin: wpMandrill » Using Mandrill in other Plugins

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author MC_Will

    (@mc_will)

    No, you just need to have wpMandrill activated.

    Where and when are you calling it?

    There are some scenarios where the plugin might not be loaded. Be sure it is.

    I see. I already have it activated and I know it definitely works as a test email always is sent out properly.

    I was testing the function call with a plugin called ‘Product Enquiry for Woocommerce’ which is available for download on this site (link here: Product Enquiry).

    I replaced line 212 which says:

    @mail($to, $subject, $body, $headers) or
    		die("Unfortunately, a server issue prevented delivery of your message.");

    …with this….

    wpMandrill::mail($to, $subject, $body, $headers) or
    		die("Unfortunately, a server issue prevented delivery of your message.");

    Plugin Author MC_Will

    (@mc_will)

    PHP mail() function returns false on error. wpMandrill::mail() returns WP_Error on error. You can’t just swap the functions.

    I see. OK. What is your suggestion then?

    You shouldn’t use php mail() in a WordPress plugin. You don’t need to hard code mandrill into a plugin either. Well… not ideally. There are potential situations maybe…

    But you can just use wp_mail(). Which is the desired way to send emails in WordPress 99% of the time. Mandrill replaces that to send through their smtp.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using Mandrill in other Plugins’ is closed to new replies.