4

I have an e-mail problem at Craft Commerce. Emails are not sent at the time of purchase. The e-mail is only sent when you log in to the backend.

I first thought it was a server queue problem. But the support of our Nginx server could not find any error. I have also already tried out various e-mail sending options. Strangely enough, contact form e-mails are sent immediately and without delay.

The problem occurred first when updating Craft Commerce.

pepe
  • 315
  • 1
  • 8

2 Answers2

8

Thanks to @PhilipBoomy for his answer. The problem were missing cron jobs.

Additionally I want to add one more solution from the craft support team:

If you don't have the queue set up to run automatically with a cron job or worker, you can also try adding this to your order confirmation template:

{# run queue #}
{% do craft.app.queue.handleResponse %}
{{ craft.app.response.content|raw }}

Which will run the queue over Ajax on that page.

pepe
  • 315
  • 1
  • 8
4

They changed it to use queue jobs - see here https://docs.craftcms.com/commerce/v3/order-status-emails.html#settings - You can set up a cron job that runs the queue job every x mins or use this plugin https://github.com/ostark/craft-async-queue to automatically run the queue after Commerce send the email job to the queue.

PhilipBoomy
  • 166
  • 4
  • Awesome resource on queue handling in Craft 3 here, that is definitely worth a read: https://nystudio107.com/blog/robust-queue-job-handling-in-craft-cms – Jeremy Daalder Jun 24 '20 at 05:00