1

I have placed a successful order in Commerce and it's settings have an email setup to send an email to the customer and use the example special/receipt email.

But the receipt email is not sent once the order is placed.

If we login to the admin and go to the order page, selecting Send Email and choosing the customer receipt then it does send it OK.

So the receipt email is all setup OK and sends using the function in the order screen, its just not sending after the order is placed.

There is no commerce.log in storage. web.log doesn't have any logs related to commerce or the order. There is nothing in the Queue related to this (only loads of failed "Updating search indexes" and "Generating products sitemap" which is a whole other issue).

Does anyone know what it could be or how I could even go about debugging this when email works and I can't find any logs about its not sending?

Thanks

5
  • Just a guess, and I would really expect an error then, but you might well be hitting the issue with sessions - craftcms.stackexchange.com/questions/35920/… - as when you're accessing the order by the back end, there is a session available, but probably not when the email is being sent via a queue...see also: craftcms.stackexchange.com/questions/36359/… Feb 24 at 1:49
  • I dont think its related to using cart in the template, as its not there. If I replace the receipt.twig content with just the word test, its still not sent. I dont get errors reported in both those if I search the logs. The only thing I have not done is log errors if its a console request. Surprised thats not done anyway. Feb 24 at 11:15
  • I've just realised in the Emails section there is no action to choose when to send this. No "On new order" action... so how does the system know to send this email on a new order? Maybe related. Feb 24 at 11:25
  • OK well thats the issue! See my answer to the fix, missed a step in the setup! Feb 24 at 11:42
  • Glad you got there - sorry, should have checked on the basics first!...the issue I described has just become my pet issue as it's cropping up a lot. Feb 24 at 20:42
1

Simple step missing on the setup of this. I needed to actually assign this email to the status New, to send when a New order is placed, in the Order Statuses section, as per this documentation. So simply a case of RTFM: https://craftcms.com/docs/commerce/3.x/order-status-emails.html#selecting-an-email

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.