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.

2 Answers 2

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.

1
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.

2
  • I like that. A simple solution. Jun 17, 2020 at 9:09
  • Perfect! Thanks a lot!
    – outline4
    Jul 12, 2021 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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