在Prestashop联系表格电子邮件模板中获取主题标题

时间:2015-10-27 21:59:15

标签: smarty prestashop

我在Prestashop联系表单中有几个主题的下拉选项。

<select id="id_contact" name="id_contact" class="form-control" onchange="showElemFromSelect('id_contact', 'desc_contact')">
    <option value="0">-- Please chose --</option>
    <option value="1">Cancel order</option>
    <option value="3">Check order</option>
    <option value="2">Return a product</option>
</select>

是否有可能在收到的确认电子邮件中创建或拥有所选主题的价值?:

1 个答案:

答案 0 :(得分:0)

如果您在后台添加此主题作为联系人姓名,则在controllers/front/ContactController方法postProcess()中找到阻止:

$var_list = array(
                                    '{order_name}' => '-',
                                    '{attached_file}' => '-',
                                    '{message}' => Tools::nl2br(stripslashes($message)),
                                    '{email}' =>  $from,
                                    '{product_name}' => '',
                                );

并添加$contact->name,例如到{message}

'{message}' => '<br />Subject: '. $contact->name . '<br />' .Tools::nl2br(stripslashes($message)),