[-] CORE : fixed bug #PSCFV-8745 Contact form e-mail template with incomplete information
This commit is contained in:
@@ -170,6 +170,7 @@ class ContactControllerCore extends FrontController
|
||||
'{attached_file}' => '-',
|
||||
'{message}' => Tools::nl2br(stripslashes($message)),
|
||||
'{email}' => $from,
|
||||
'{product_name}' => '',
|
||||
);
|
||||
|
||||
if (isset($filename))
|
||||
@@ -177,6 +178,8 @@ class ContactControllerCore extends FrontController
|
||||
|
||||
$id_order = (int)Tools::getValue('id_order');
|
||||
|
||||
$id_product = (int)Tools::getValue('id_product');
|
||||
|
||||
if (isset($ct) && Validate::isLoadedObject($ct))
|
||||
{
|
||||
if ($ct->id_order)
|
||||
@@ -193,6 +196,13 @@ class ContactControllerCore extends FrontController
|
||||
$var_list['{id_order}'] = $id_order;
|
||||
}
|
||||
|
||||
if ($id_product)
|
||||
{
|
||||
$product = new Product((int)$id_product);
|
||||
if (Validate::isLoadedObject($product) && isset($product->name[Context::getContext()->language->id]))
|
||||
$var_list['{product_name}'] = $product->name[Context::getContext()->language->id];
|
||||
}
|
||||
|
||||
if (empty($contact->email))
|
||||
Mail::Send($this->context->language->id, 'contact_form', $subject, $var_list, $from, null, null, null, $fileAttachment);
|
||||
else
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">Your message has been sent successfully.<br /><br /> Message: {message}<br /><br /> Order ID : {order_name}<br /><br /> Attached file : {attached_file}</td>
|
||||
<td align="left">Your message has been sent successfully.<br /><br /> Message: {message}<br /><br /> Order ID : {order_name}<br /><br /> Product : {product_name}<br /><br /> Attached file : {attached_file}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
||||
Reference in New Issue
Block a user