[-] CORE : fixed bug #PSCFV-8745 Contact form e-mail template with incomplete information

This commit is contained in:
Vincent Augagneur
2013-06-26 18:01:26 +02:00
parent b8df8e6fb1
commit 56e75d0e9a
2 changed files with 11 additions and 1 deletions

View File

@@ -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

View File

@@ -20,7 +20,7 @@
<td>&nbsp;</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>&nbsp;</td>