Jump to content

(SOLVED) How to add customer id to order and welcome emails.


Recommended Posts

That won't work since those variables aren't passed in the mail template. You must add them by changing line 111 of authentication.php )in PrestaShop v1.3.1) from:

if (!Mail::Send(intval($cookie->id_lang), 'account', 'Welcome!', 
array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname))



to:

if (!Mail::Send(intval($cookie->id_lang), 'account', 'Welcome!', 
array('{id_customer}' => $customer->id, '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname))



Then you can use {id_customer} in the account.html and account.txt mail templates.

To do the same for the order_conf.html and order_conf.txt mail templates, you'll need to change lines 308-309 of classes/PaymentModules.php (in PrestaShop v1.3.1) from:

$data = array(                    
'{firstname}' => $customer->firstname,



to:

$data = array(                    
'{id_customer}' => $customer->id,
'{firstname}' => $customer->firstname,

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...