[-] 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}' => '-',
|
'{attached_file}' => '-',
|
||||||
'{message}' => Tools::nl2br(stripslashes($message)),
|
'{message}' => Tools::nl2br(stripslashes($message)),
|
||||||
'{email}' => $from,
|
'{email}' => $from,
|
||||||
|
'{product_name}' => '',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($filename))
|
if (isset($filename))
|
||||||
@@ -177,6 +178,8 @@ class ContactControllerCore extends FrontController
|
|||||||
|
|
||||||
$id_order = (int)Tools::getValue('id_order');
|
$id_order = (int)Tools::getValue('id_order');
|
||||||
|
|
||||||
|
$id_product = (int)Tools::getValue('id_product');
|
||||||
|
|
||||||
if (isset($ct) && Validate::isLoadedObject($ct))
|
if (isset($ct) && Validate::isLoadedObject($ct))
|
||||||
{
|
{
|
||||||
if ($ct->id_order)
|
if ($ct->id_order)
|
||||||
@@ -193,6 +196,13 @@ class ContactControllerCore extends FrontController
|
|||||||
$var_list['{id_order}'] = $id_order;
|
$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))
|
if (empty($contact->email))
|
||||||
Mail::Send($this->context->language->id, 'contact_form', $subject, $var_list, $from, null, null, null, $fileAttachment);
|
Mail::Send($this->context->language->id, 'contact_form', $subject, $var_list, $from, null, null, null, $fileAttachment);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
|||||||
Reference in New Issue
Block a user