有谁知道如何.tpl
在 prestashop 的文件中添加 php 代码..我尝试了很多但找不到任何解决方案..我想在我的.tpl
文件中添加一个邮件功能
这是功能
<?php
$name=$_REQUEST["name"];
$email=$_REQUEST["email"];
$matter=$_REQUEST["matter"];
$subject=$name."has shared a weblink";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$contactMsg = '
<html>
<head>
<title>Tell A Friend</title>
</head>
<body>
<table>
<tr>
<td>E-mail: '.$email.' </td>
</tr>
<tr>
<td>Comment: '.$matter.' </td>
</tr>
</table>
</body>
</html>
';
$headers .= "from:abcd" . "\r\n";
$headers .= "To: Info <info@abcd.in";
$headers .= "reply-to:".$email."\r\n";
$headers .= "Cc:".$email."\r\n";
$headers .= 'Bcc: ' . "\r\n";
if(mail($email, $subject, $contactMsg, $headers))
{
$_REQUEST = array();
$error.="Mail Sent Successfully";
}
else
{
$error.="Error Mail Sent Fail!";
//
}
?>
我尝试在块内编写代码..{php}
{/php}
但无法帮助以及如何查看error log
prestashop