2

Folks:

I'm wondering if this is a bug or something else. Essentially, test emails from the system work fine but emails that are supposed to be sent when the order moves to "Processing" do not. The log file from yesterday states: 2016/03/17 14:31:52 [info] [plugin] [Forced] Can't send email if no status or emails exist.

But there is a status (processing) and an email for that status ({{ order.email }}). I have attempted several dummy transactions today as well but the emails don't come through and the logs don't update either. And no, there's nothing in the spam folder. Or error messages sent back to the host.

I even tried to have the order emails sent to a specific email address instead of {{ order.email }}. No joy.

Finally, I am using the default commerce templates so I'm pretty sure the issue isn't there.

Does anyone have any ideas?

2

The error is not telling you that the email address is missing, I think, but rather that the email itself to send is missing.

Have you assigned an actual email to send for that particular status?

Commerce->Settings->Order Statuses - check the column 'Has Emails' has a value of 1 or more in it.

(To actually assign one, create it first in the email section, and then in this section click on the order status and in the bottom field 'Status Emails' you'll then be able to choose your created email).

Based on the error and the code generating it (in Commerce_OrderStatusesService.php) - I would say you've set up a status but not actually assigned the email you've made to it.

| improve this answer | |
  • Thanks for this. Unfortunately, the email is assigned to the status. Sorry for the confusion. Looking back, this error occurred before I did exactly what you're suggesting. Now, the error no longer appears but emails still aren't going out. – Wonko Mar 19 '16 at 4:51
  • Ok, well if you're not getting that error anymore, then it points to an email deliverability problem. As in, it's most likely they are going out, but they're not getting through to the recipient email. If there are issues with your email template being parsed, you'd see those in commerce.log, but assuming it is not that, then I'd day you need to look at your email setup. Are you using phpmail, or smtp, or (best option) a transactional email service like e.g. Mandrill, mailgun, sparkpost etc.? – Jeremy Daalder Mar 19 '16 at 5:51
  • I'm pretty sure they're not going out at all. I sent a couple of test emails and then executed a couple of dummy transactions. Then I contacted the host to see what was actual sent. They only have a record of the test emails going out. I'm using SMTP email but I'll look into a transactional service. – Wonko Mar 19 '16 at 11:25
0

This was related to the email template. The template includes {% set number = craft.request.param('number') %}. .param('number') does not exist in the context of checkout. This means the order doesn't exist and the page redirects to commerce/customer which makes no sense when it comes to email. So no email.

Commenting out or removing {% set number = craft.request.param('number') %} solves the problem.

Thanks to P & T support for the answer. And to Jeremy Daalder for his help.

| improve this answer | |
  • I think you missed this in my comment above: "If there are issues with your email template being parsed, you'd see those in commerce.log" ...that's the take home point for people trying to self diagnose this issue in the future - if there's problems parsing your email template, that's where they appear. If you'd look in there, you can find these issues quickly. – Jeremy Daalder Mar 23 '16 at 0:37
  • I'm uncertain if this would actually be recorded in the logs. The parsing appeared to be fine and the system went through the motions without a clear error (order doesn't exist > redirect > no need to send email). Checking the logs (and I don't pretend to be an expert here), there isn't anything there that would help in this case. From what I can see, the template is named in the error (e.g. Twig_Environment->render('templatename', Array) but the template in question isn't listed in the log. – Wonko Mar 23 '16 at 14:58

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.