Magento 2 – How to fix ” The order confirmation email is not sent “

Magento2 Teaser

This morning I was working on an email issue ( multi-store ) where customers were able to purchase but didn’t receive the order confirmation email.

As always, I had a look at what has been deployed recently and checked pretty much all logs on the production environment. Unfortunately, I couldn’t find anything.

I started looking at database changes, especially the core_config_data table, and noticed that the template for the order confirmation was defined twice. This was kind of weird because those email settings were set to ” Use System Value “.

I ended up deleting the IDs 4293, 4296, 4299 which has fixed the issue immediately. I still don’t know why those values were set twice, but I hope this will help someone…sometime.

Useful Postfix Commands

If your server is configured to send emails with postfix, you should be familiar with some basic Postfix commands without any help from your sysadmin.

1. List your default and custom settings

If you have added your custom Postfix settings or set your own email aliases with virtual_alias_maps, you will find it with postconf -n.

If you want to see your Postfix default settings, just change the parameter -n to -d.

It’s a good practise to keep this output as a running configuration snapshot in a simple text file in case you have any troubles with Postfix after server reboot or software updates.

2. List the current queue and email id’s

Check your postqueue frequently to make sure all your emails were delivered correctly. If everything is okay you will see the message “Mail queue is empty”. Otherwise, you will see a list of  undelivered emails.

3. Read emails from the queue

4. Delete emails from the queue