Posted on

New SMTP Pro Magento Email extension released

I’ve had a chance to make a couple of improvements to my SMTP Pro email extension for Magento. Both changes are not exactly life altering, one adds extra error detection to the self-test, and the other fixes a header problem with the self-test (reported by Phil). More details follow about the changes, if you want to get the extension, download SMTP Pro on Magento Connect. (Updated: finally on Magento Connect!)

I now send a real live contact form message as part of the testing – and ensure that when the email sends, my extension code is actually being called. I’ve had a lot of people reporting problems with emails not sending lately, only to find it’s because some other extension is interfering with my email sending. This tweak to the self test will help identify those issues.

This is implemented as a static variable on the self test controller, that is set before sending the test email and then altered by the email observer (if it is called as expected):

// Now we test that the actual core overrides are occuring as expected.
// We trigger the password forgot email, as though a user had done so.
self::$CONTACTFORM_SENT = false;
// If everything worked as expected, the observer will have set this value to true.
if (self::$CONTACTFORM_SENT) {
	$msg = $msg . "<br/> Contact Form test email used SMTPPro to send correctly.";
} else {
	$success = false;
	$msg = $msg . "<br/> Contact Form test email did not use SMTPPro to send.";

and the code in the observer that alters this variable:

// For the self test, if we're sending the contact form notify the self test class
if($event->getTemplate() == "contacts_email_email_template") {
        include_once "app/code/community/Aschroder/SMTPPro/controllers/IndexController.php";
        Aschroder_SMTPPro_IndexController::$CONTACTFORM_SENT = true;

The other change was trivial, adding a ->setFrom() call when sending the test email. Thanks to Phil for pointing that out.

Lastly, Eric requested a useful feature which I will add, but I haven’t had time to put that in to this release, next time!

Let me know any feedback you have on the changes, or if you’re having trouble sending emails in Magento – feedback welcome.

Posted on

Pre-release: SMTP Pro / Magento Gmail & Google Apps Email Beta testing (win a prize)

In a bid to help solve a weird 404 error that Kevin has been experiencing with the self test I offered him a pre-release copy of my upcoming ‘unified’ Magento email extension. It will support both SMTP and Google Apps/Gmail along with a few new features.

Anyway, if anyone is keen to try the extension please contact me or flick me an email or post a comment and let me know, I’ll send through the files, I’d rather not post it for public availability here yet, because it’s not as stable as I’d like. But expect it very soon!
Continue reading Pre-release: SMTP Pro / Magento Gmail & Google Apps Email Beta testing (win a prize)