Back to Top

Add custom block in the order confirmation email

Updated 25 July 2024

Hello Friends!!!

In this blog, we are going to learn how we can add a custom block in the order confirmation email.

Override email template file: To add our custom block in the email template, we can override the order_new.html email template file inside the app/code/Vendor/Custommodule/view/frontend/email/ directory and add the custom block class and template as follows:

{{block class="Vendor\Custommodule\Block\Checkout\DeliveryInfoSummary" area="frontend" template="Vendor_Custommodule::email/order/deliveryInfo.phtml}}
adding custom block

Override email template at admin end: To add a custom information block, we can create a new template and add our custom block in the new template at the admin end, and then we can select the new template as the default template for the order confirmation email as following images:

email template
template content
order confirmation template

Now, when the customer will get the order confirmation email. We can see the custom information block in the email as the following image:

Searching for an experienced
Magento 2 Company ?
Find out More
in mail template content

Hope this will be helpful. Thanks 🙂

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home