cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Shipment Emails

SOLVED

Problem with Shipment Emails

I am having problems with Magento emails.

The cron sends the Order Confirmation and Invoice emails fine - but NOT the shipment emails. They are definitely enabled in Configuration / Sales / Sales Emails. (I have also added a 'copy to' email address to check what is being sent out.)

Can anyone help?

 

Tags (1)
8 REPLIES

Re: Problem with Shipment Emails

Are you using the default out of the box templates or have you customized them?

 

Are you able to SSH into your box and tail the mail logs to see if the mail was even attempted?

-Kris
4x Certified, Blogger @ xgento.com

Re: Problem with Shipment Emails

Yes, Phil as Kab8609 referenced the the error and exception logs ({Magento root}/var/logs/) are a great place to start. Look for mail or order related errors or warnings. Looking in there should give you a clue as to what is going on.

 

Another good log to check is your servers mail log. This will at minimum show you if an email was sent out from the server. Typically this is found at /var/log/maillog but is dependant on your OS and mail software. Best of luck getting it sorted out.

Re: Problem with Shipment Emails

I've not customised the shipment emails at all.

What does 'SSH into your box' and 'tail the mail logs' mean?

(Sorry I'm relatively new Magento)

Re: Problem with Shipment Emails

I've had a look at the exception logs and this looks promising - although I don't understand what to do next:

 

2015-03-18T13:26:54+00:00 ERR (3): 

exception 'Exception' with message 'This letter cannot be sent.' in /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Core/Model/Email/Template.php:374
Stack trace:
#0 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Core/Model/Email/Template.php(508): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#1 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(84): Mage_Core_Model_Email_Template->sendTransactional('sales_email_shi...', 'sales', Array, Array, Array, '6')
#2 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Sales/Model/Order/Shipment.php(462): Mage_Core_Model_Email_Template_Mailer->send()
#3 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php(222): Mage_Sales_Model_Order_Shipment->sendEmail(true, '')
#4 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_Order_ShipmentController->saveAction()
#5 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('save')
#6 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#8 /var/www/vhosts/avanor.co.uk/httpdocs/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /var/www/vhosts/avanor.co.uk/httpdocs/magento/index.php(87): Mage::run('', 'store')
#10 {main}

Re: Problem with Shipment Emails

So looking in Mage/Core/Model/Email/Template.php, it looks like the function send() is throwing an exception there, which is caused by isValidForSend() returning false.

 

isValidForSend() only checks four things and returns false if any of them are false:

  • Is the system email enabled (you said it is)
  • Is there a sender name?
  • Is there a sender email address?
  • Is there a template subject?

Guessing from that, I'd double check to make sure your sender information in System Configuration is set (probably the ones in General > Store Email Addresses) and that your template for that problematic email has a subject line (and that it doesn't look weird somehow, while you're there).

 

Re: Problem with Shipment Emails

Not sure what you mean by 'system email'. I take it is must be enabled for the Order and Invoice Emails to work...

 

The Shipment Emails (and the Credit Memo Emails, which don't work either, now I think about it) use the same Email Contact (Sales Representative) as the Invoice and Order Emails, which work. I take it that's where the Sender Name and Sender Email address come from. 

 

The templates are 'off the shelf', I haven't touched them at all. Does this subject line look 'weird' to you? :

<!--@subject {{var store.getFrontendName()}}: Shipment # {{var shipment.increment_id}} for Order # {{var order.increment_id}} @-->

Re: Problem with Shipment Emails

The system email is just a setting in configuration that disabled email for the entire site - if any email is getting out, it's safe to assume that's not the problem.

 

Sounds like your sender name and email is fine, then - if that were the problem, I'd expect the problem to come up with all emails.

 

The subject line does look okay to me at a glance .

 

Honestly, if I were having this problem, I'd start just throwing a little debugging code in there to spit out what the code is seeing for the sender name, email, subject line, etc at the point in the code when it's throwing the exception. If you're not familiar with Magento's core code and would rather not do that, though, hopefully someone else here has a little more insight than I do. I haven't had much trouble with email in Magento, so I haven't really done much with it.

Re: Problem with Shipment Emails

I solved the problem. I created custom transactional emails and linked them in the configuration settings - and they all worked. (There must have been a problem with the 'originals'.)