cancel
Showing results for 
Search instead for 
Did you mean: 

i want to write a update qurey before sending the order mail to customer mail magento 2 ?

i want to write a update qurey before sending the order mail to customer mail magento 2 ?

Hi guys ,

                  i want to write a update qurey before sending the order mail to customer mail. where can i find phtml file for email. is this possible . if yes, can anyone guide me ?

3 REPLIES 3

Re: i want to write a update qurey before sending the order mail to customer mail magento 2 ?

You need to write your query in  below file,

vendor/magento/module-sales/Model/Order/Email/Sender/OrderSender.php

In the above file, send() function is used for send order mail to a customer,

 

$order->setSendEmail(true);

You need to write query above this line and create plugin for this function.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: i want to write a update qurey before sending the order mail to customer mail magento 2 ?

is there any phtml file for email ? 

Re: i want to write a update qurey before sending the order mail to customer mail magento 2 ?

@bharath553

you can find the phtml files related to orders here 

 

 

vendor/magento/module-sales/view/frontend/templates/email/

 

 

and html files are on this path

vendor/magento/module-sales/view/frontend/email

But not sure how you will be going to write an update query in phtml, Rakesh's answer is the correct way to implement it.

 

If Issue Solved, Click Kudos/Accept As solutions