cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the order mail and aadding a variable from the database in it

Changing the order mail and aadding a variable from the database in it

Hello All,

 

I want to change the email the user receives when placing an order.

 

I installed Oyes delivery date module  (http://oyenetwork.com/articles/magento2-devliery-date-module-creation-from-scratch/) an d it works fine, puts the date into the order and order_grid database, but i cannot convey it towards the email.

 

The documentation of magento speaks only of the variables by the system (So store name etc.) and gives you the [possibility to add your own variables, but those are all hardcoded and not from the database eg. you could make a var named ""yippie" and make the content "yay" but no more than that.

 

The db and tables used are 

 

Sales_order (Delivery_date)

Sales_order_grid (Delivery_date)  

Quote  (Delivery_date)

 

What i would like to see in the email send to costumer would be something like Smiley Very Happyelivery date ;and here the date from one of the three tabels.....

 

There are several unanswered forum questions onto this topic all a bit different but still consisting of 1 main question, how to put database data into the order email, you would help a lot of people by giving an answer, not to mention the honorable name of Magento_God of the Week :-)

2 REPLIES 2

Re: Changing the order mail and aadding a variable from the database in it

Please Override the following file

/var/www/html/app/code/core/Mage/Sales/Model/order.php

and and your custom variable value here near by 1336 line number.

$mailer->setTemplateParams(array(

'order'     => $this,

'billing'   => $this->getBillingAddress(),

'payment_html' => $paymentBlockHtml,

'custom_var' => 'custom_value'

));

After this add this variable in your new_order template.

app\locale\en_US\template\email\sales\order_new_guest.html

and add like this {{var custom_var}}

Or Use This Link

http://oyenetwork.com/articles/magento2-devliery-date-module-creation-from-scratch/

OpenSource Expert | OpenSource Technologies | www.opensourcetechnologies.com
Magento plugins released: http://www.opensourcetechnologies.com/product/product-category/magento-extensions

Re: Changing the order mail and aadding a variable from the database in it

I think you are referring to a PRE- 2 magento version , i work with magento 2 

 

Do you also have a solution for 2?

 

thnx