cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3 not sending order confirmation Email

Magento 2.3 not sending order confirmation Email

Hi

i've recently moved my Magento 2.3.5 website to a new provider and since then i have some issues. The most annoying one is that order confirmation Emails are not sent out.

SMTP configuration is ok, test email works fine. Mageplaza SMTP is installed and shows many entries (contact form, shipment confirmation) but no order confirmation emails.

I think it's a cron issue but don't know where to look sincerely..

7 REPLIES 7

Re: Magento 2.3 not sending order confirmation Email

Hello @aezakmi 

 

Kindly check your Var/log to see any warning or error related to mail. And you also check following configuration

 

Got to Stores -> Configuration -> Advanced -> System

 

Under Mail Sending Settings make sure -  Disable Email Communications is set to No.

 

Also verify your Host and Port fields if you are using any external mailing server.

 

Go to Stores -> Configuration -> Sales -> Sales Emails

 

Under General Settings tab, choose Asynchronous sending to Disable

 

Under Order tab Enabled to Yes

 

Now clear/refresh your cache.

 

Hope this helps you.

Got to Stores -> Configuration -> Advanced -> System

 

Under Mail Sending Settings make sure -  Disable Email Communications is set to No.

 

Also verify your Host and Port fields if you are using any external mailing server.

 

Go to Stores -> Configuration -> Sales -> Sales Emails

 

Under General Settings tab, choose Asynchronous sending to Disable

 

Under Order tab Enabled to Yes

 

Now clear/refresh your cache.

 

Hope this helps you.

 

------------------------------------------------
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Magento 2.3 not sending order confirmation Email

Hi @syedhasan 

 

thanks for the kind reply.

 

Unfortunately all steps you suggest are already correct..

 

In var/log i found something but doesn't seem to be correlated to that issue:

main.CRITICAL: DOMDocument::loadHTML(): Tag date invalid in Entity, line: 1 {"exception":"[object] (InvalidArgumentException(code: 2): DOMDocument::loadHTML(): Tag date invalid in Entity, line: 1 at /home/u314884553/domains/golfballs24.com/public_html/vendor/magento/framework/Escaper.php:94)"} []

what else can i do? 

Thanks!

Re: Magento 2.3 not sending order confirmation Email

Hi @aezakmi 

 

Possible fix

 

/module-sales/view/frontend/templates/order/order_date.phtml change "date" tag with "span"

 

 

------------------------------------------------
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Magento 2.3 not sending order confirmation Email

Hi @syedhasan,

 

this is what is inside that file, what should i change?

<div class="order-date">
    <?= $block->escapeHtml(__('<span class="label">Order Date:</span> %1', '<date>' . $block->formatDate($block->getOrder()->getCreatedAt(), \IntlDateFormatter::LONG) . '</date>'), ['span', 'date']) ?>
</div>

Thanks

Re: Magento 2.3 not sending order confirmation Email

checkout_onepage_controller_success_action.
Create a simple method isEnable() using OrderIdentity.php to ensure that order confirmation email is not sent twice. 

Register event under events.xml using below code
[Package_Name]\[Module_Name]\etc\frontend\events.xml

 
1
2
3
4
5
6
7
<?xml version="1.0"?>
 
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_onepage_controller_success_action">
        <observer name="checkout_onepage_controller_success_action_sendmail" instance="[Package_Name]\[Module_Name]\Observer\SendMailOnOrderSuccess" />
    </event>
</config>

Once the event is registered, create Observer class in the following file:
[Package_Name]\[Module_Name]\Observer\SendMailOnOrderSuccess.php

 
 

After adding observer code, an email will be sent to customers on successful order payment. To avoid order duplication Email, we need to create a plugin using the di.xml file.
[Package_Name]\[Module_Name]\etc\di.xml

 
 

Create another file along with ‘di.xml’ that is OrderIdentityPlugin.php to remove duplication of email.
[Package_Name]\[Module_Name]\Plugin\Sales\Order\Email\Container\ OrderIdentityPlugin.php

 

There you go!
Now you may start sending the order confirmation Emails to your customers only after the payment is successful. ?

You may contact me if you need customization in the code to add further functionalities.
Doubts for the same is welcomed in the comments section

Re: Magento 2.3 not sending order confirmation Email

Hi @ngohang4891039 

thank you for your reply.

This is already something too much technical for me, i'm a newbie to Magento.

What i don't understand is why the email were working perfectly before the migration and now they don't? Nothing was changed in settings.. 
Can it be something cron related?

Re: Magento 2.3 not sending order confirmation Email

Hi @aezakmi 

 

Trust you are doing well,

 

I think for this solution you must avoid all these complicated solutions and install a free extension namely Magento 2 Order Confirmation Email. It helps in sending an order confirmation to your customers after successful payment status.

 

Hope this helps you,

Problem solved? Hit the Kudos button and "Accept it as Solution"