Posted on

Using SMTP Pro and Ebizmarts’ MailChimp extension in Magento

This is just a quick blog post that will hopefully help people facing the clash in Magento between my SMTPPro email extension and Ebizmarts’ MailChimp extension.

The clash occurs only in one class Mage_Core_Model_Email_Template which we both override to extend the default Magento email sending capability.

Because it only makes sense to use either SMTPPro or MailChimp as your ESP if you want to use SMTP Pro you can safely disable the MailChimp core class override and then SMTPPro will send the store emails using whichever method you have configured.

Update July 2013: I have since released a premium extension for sending email using Amazon SES called MageSend, if you’re having toruble sending email with Magento, please check it out, it was created to solve many common Magento email issues.

To remove the core override edit code/local/Ebizmarts/Mailchimp/etc/config.xml and remove the following XML:

<core>
    <rewrite>
        <email_template>Ebizmarts_Mailchimp_Model_Email_Template</email_template>
    </rewrite>
</core>

When/Why is this safe to do?

You can do this when you are not using the MailChimp STS capability and want to use SMTPPro to send your emails. If you don’t want to send via SMTPPro, just uninstall it to resolve the conflict.

You can see in the first lines of the override class Ebizmarts_Mailchimp_Model_Email_Template why this is safe:

if(!Mage::helper('mailchimp')->isStsActivated()){
    return parent::send($email, $name, $variables);
}

This means that if you are not using STS, then the whole override is basically a noop.

One caution I have for you though, once you modify an extension, you have to remember to apply the same patch each time you upgrade it, otherwise the clash will creep back in!

Update: I missed some emails notifying me of comments, I missed this fairly important one from Ebizmarts with basically this fix in it… On a related note, if I didn’t reply to your comment for the last few weeks, that’s why.

14 thoughts on “Using SMTP Pro and Ebizmarts’ MailChimp extension in Magento

  1. Hi Ashley, it would be great if Magento had an observer to do this. Wouldn’t it?

  2. The reason you might want/need to do this: Amazon SES is way too cumbersome to setup versus SendGrid, but you still want the wonderful features and setup of MailChip but with the dandy integration to Mage via the eBizSmarts extension, and you need the speed and delivery reporting from SendGrid.

    Thanks Ashley!

  3. Yep, an observer would be ideal. I started putting events into my code that other extensions could hook in to, but the problem is other developers can’t rely on it being there, so you still need the core override. Once you have the override, even with a if (!active) do nothing;, it still causes a clash. So +1 for a sequence of core events for email sending/attaching.

  4. I’m fairly new to this, so I’m a little confused!

    I want to use SMTP Pro so that my magento installation uses my google apps email account. I want to use mailchimp for collecting & processing email addresses for email newsletters. I’m not using the mailchimp STS functionality.

    Is it the case that I just need to make the edit as detailed above and I’ll be able to have what I’ve described above?

    Thanks

    John

  5. Thanks for this one, been wondering why the two don’t play nice.

  6. Hi, Yes that’s right, if you;re not sending transactional store emails via Mailchimp’s STS, you can safely remove the override.

  7. Hi Ashley,
    I’m running my sit on magento 1.5.1 and I use mailchimp only for newsletter integration.
    I did remove the override, hoever I still get this result:

    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using Google Apps/Gmail configuration options
    Connection to Host SMTP server successful.
    Sending test email to your contact form address http://www.mielepietrangeli.com:
    Unable to send test email. Exception message was: 5.1.2 We weren’t able to find the recipient domain. Please check for any 5.1.2 spelling errors, and make sure you didn’t enter any spaces, periods, 5.1.2 or other punctuation after the recipient’s email address. p2sm10598109wbo.17 …
    Please check and double check your username and password.
    Contact Form test email did not use SMTPPro to send.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    Where’s the problem?
    Thank you
    Andrea

  8. Hello Ashley, Thanks to the fix the bug now I can send email order.
    But I can not send email contact !!
    Before everything was ok
    But after installing “Ebizmarts_MageMonkey” I can not send emails to contact
    http://www.dieltron.com/contacts/

    Can you help?
    thanks
    Javi

  9. Hi Ashley

    My problem is that evil had changed contact_form.html

    He believed that the problem was MailChimp, but the problem was a bad configuration contact_form.html

    Sorry for bothering

    Thank you for your extensions!

    Javi

  10. Hi,

    I have to send one custom email so how to do it in mailchimp

    i installed mailchimp in magneto but i have to send custom email !! before that i create one email template from magento back end of id 3 no i have to send that mail through mail chimp how to do that?
    it will automatically done or i have to do some thing
    please help me

  11. Hi Ashley,

    Our company just switched to Magento. We’ve been using SMTP Pro and it works great, but I’ve not been able to get Magento product alerts to send out emails. I’m wondering if there’s an issue there?

  12. The core alerts or some 3rd party? If 3rd party, they might be sending emails weirdly.

  13. Ashley

    Could you please advise if there is any clash with aschroder smtp pro extension and MailChimp extension?

    I use Ebizmarts_MageMonkey 1.0.22

    I’ve read through the following posts, BUT

    http://www.aschroder.com/2011/06/smtp-pro-with-magento-a-sort-of-user-guide/comment-page-1/#comments
    http://www.aschroder.com/2011/09/using-smtp-pro-and-ebizmarts-mailchimp-extension-in-magento/

    this folder does not exist
    code/local/Ebizmarts/Mailchimp/etc/config.xml

    Instead I’ve got
    app/code/community/Ebizmarts/MageMonkey/etc/config.xml

    and it does not have

    Ebizmarts_Mailchimp_Model_Email_Template

    Please advise,

    Thanks!

  14. Hi Viktor, Ashley,

    We’re running the Ebizmarts MageMonkey integration with mailchimp and have followed the instructions in http://www.aschroder.com/2011/09/using-smtp-pro-and-ebizmarts-mailchimp-extension-in-magento/, flushing the cache afterwards.

    I just thought I’d let you know that with the version of the MageMonkey plugin we’re using (1.0.19, old version) there seems to be two locations where the config.xml has to be changed.

    The first is in /app/code/community/Ebizmarts/MageMonkey/etc and the second is in /app/code/community/Ebizmarts/Mandrill/etc. In both config.xml there is an email-related override.

    Not sure how this applies to later versions of the MageMonkey plugin.

Comments are closed.