- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
i have created email template in admin panel i want to send this template with order details programmatically. Please help me on this.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was just a piece of code explaining how to set email template, as I said, follow this tutorial :
https://meetanshi.com/blog/send-custom-emails-programmatically-in-magento-2/
and you can set your order details in array
$templateVars = [ 'name' => '[FETCH CUSTOMER NAME FROM BILLING ADDRESS]', 'total' => '[FETCH TOTALS FROM BILLING ADDRESS]' ];
and you can pass those variables which can be used in template like below :
{{var name}} {{var total}}
Let us know if it works for you !

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: how to admin panel created email template with order details
Kindly refer below link :
https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/templates/template-email.html
It may help you!
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: how to admin panel created email template with order details
Hello @tippanna_pawar
Refer to this blog it shows how to send email programatically by using admin email email template :
https://meetanshi.com/blog/send-custom-emails-programmatically-in-magento-2/
PS : In any email sending code, just pass the email-template-identifier like below :
$this->transportBuilder->setTemplateIdentifier($templateId, $storeScope)
Hope it helps !

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: how to admin panel created email template with order details
but i tried with the below code it is sending empty template without order details..? Can help me in sending order details to it.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was just a piece of code explaining how to set email template, as I said, follow this tutorial :
https://meetanshi.com/blog/send-custom-emails-programmatically-in-magento-2/
and you can set your order details in array
$templateVars = [ 'name' => '[FETCH CUSTOMER NAME FROM BILLING ADDRESS]', 'total' => '[FETCH TOTALS FROM BILLING ADDRESS]' ];
and you can pass those variables which can be used in template like below :
{{var name}} {{var total}}
Let us know if it works for you !
