Jump to content

[solved] Firstname in contact form


seog

Recommended Posts

Hello friends

 

I would like know how add to emails templates {firstname}

 

I added these codes but emails only display {firstname} and not the firstname writed in label from contact form

 

1. In email template I added this code:

<span style="color:#333"><strong>Message from {firstname}:</strong></span>

2. In tpl file i added this code:

<p class="form-group">
<label for="firstname">{l s='First name'}</label>
<input class="form-control grey validate" type="text" id="firstname" name="firstname" data-validate="isName" value="{$firstname|escape:'html':'UTF-8'}" />
</p>

3. In ContactController.php from I remplaced this code (line 194):

if (!Mail::Send($this->context->language->id, 'product_contact', Mail::l('Question sur {product_name}'),
$var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),
$file_attachment, null, _PS_MAIL_DIR_, false, null, null, $from) ||

 

 

 

Do you see something wrong in the code added?
Some suggestions?
 
best regards
 
 
EDIT: SOLVED FOR ME, BEST REGARDS

 

 

Edited by seog (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...