1

When looking in the logs, I see exception 'Exception' with message 'This letter cannot be sent.' in /var/www/app/code/core/Mage/Core/Model/Email/Template.php:398, which leads to:

public function isValidForSend()
{
    return !Mage::getStoreConfigFlag('system/smtp/disable')
        && $this->getSenderName()
        && $this->getSenderEmail()
        && $this->getTemplateSubject();
}

Disable Email Communications is already set correctly. What else could it be? The user enters all of these details. We've been searching for hours.

Thanks in advance!

Edit: It turned out that the template subject was always returning null. After explicitly assigning the email templates in the back-end instead of using the defaults from the locale folder, it started working again. I still haven't been able to figure out just where it comes from, but it works.

1

Change the code for a moment to this:

public function isValidForSend()
{
    Mage::log('SenderName: ' . $this->getSenderName()
              . ' Sender Email: ' . $this->getSenderEmail() 
              . ' Template Subject: ' . $this->getTemplateSubject(),null,'email_issue.log');


    return !Mage::getStoreConfigFlag('system/smtp/disable')
        && $this->getSenderName()
        && $this->getSenderEmail()
        && $this->getTemplateSubject();
}

Enable logging and after replicating the scenario check in var/log/email_issue.log.

  • Thanks. I've been able to find a solution for my issue. I've edited my original question to include it. – Thierry Sep 6 '14 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.