Hi guys
I was wondering if it's possible to get an email response which, at the beginning, will only state the person's first name rather than 'Hi Matt Smith' it would be 'Hi Matt'.
Hope you can help.
Thanks
Steve.
Started 7 months ago by Steve-Wright | 2 posts |
Hi guys
I was wondering if it's possible to get an email response which, at the beginning, will only state the person's first name rather than 'Hi Matt Smith' it would be 'Hi Matt'.
Hope you can help.
Thanks
Steve.
Hi Steve,
You need to customize some machform files for this, try to follow these steps :
1. Edit "includes/entry-functions.php" file and go to around line 288 for these code
$entry_details[$i]['value'] = $simple_name_value;
then put these code bellow that line
$entry_details[$i]['first_name'] = $entry_data['element_'.$element_id.'_1'];
$entry_details[$i]['last_name'] = $entry_data['element_'.$element_id.'_2'];
2. Edit your "helper-functions.php" file and go to around line 276 ~ 286 for these code :
if($data['element_type'] == 'textarea'){
$template_values[$i] = nl2br($data['value']);
}elseif ($data['element_type'] == 'file'){
if($target_is_admin === false){
$template_values[$i] = strip_tags($data['value']);
}else{
$template_values[$i] = strip_tags($data['value'],'<a>');
}
}else{
$template_values[$i] = $data['value'];
}
then change it to
if($data['element_type'] == 'textarea'){
$template_values[$i] = nl2br($data['value']);
}elseif ($data['element_type'] == 'file'){
if($target_is_admin === false){
$template_values[$i] = strip_tags($data['value']);
}else{
$template_values[$i] = strip_tags($data['value'],'<a>');
}
}elseif ($data['element_type'] == 'simple_name'){
$template_variables[$i] = '{element_'.$data['element_id']. '_1}';
$template_values[$i] = $data['first_name'];
$i++;
$template_variables[$i] = '{element_'.$data['element_id']. '_2}';
$template_values[$i] = $data['last_name'];
}else{
$template_values[$i] = $data['value'];
}
after that you can use email template variable like this :
{element_4_1} --> for first name
{element_4_2} --> for last name
don't forget to change the id's with yours
MachForm Support
You must log in to post.