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}}

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:



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

Hope this will be helpful. Thanks 🙂

Be the first to comment.