Jump to content

Add Variable To Email Tamplate


Recommended Posts

Hi,

 

I spend a lot of hours trying to solve the problem. Hope for your help...

 

I need to add a new variable to email template contact_form.

 

This variable will generate random number or random code (it doesnt matter). I found "Contact controller" and here I add new variable as a test:

$var_list['{test}'] = $product->name[Context::getContext()->language->id];

It is a copy of "product" variable.

 

The question:

 

How to edit it in order to have a random number.

 

Any ideas...

 

PS It is necessary to add this variable to make a ticket system. User receives Random number like a "ticket" that his letter was received and he knows the number of his inquery.

 

PPS I have a few ideas but I am newbie. For example this is Smarty code for random number:

{1|rand:20}

 

But $var_list uses "$", so it is necessary to add something like <{assign var='random' value=1|rand:20}> and than put $random to $var_list. But how and where...

 

Best regards,

Kirill

Edited by 123Kirill312 (see edit history)
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...