有人可以帮我理解问题所在。我已经尝试过几次让它正常运行,但没有成功。我正在尝试将我的 HTML 电子邮件模板插入到 php 文件中,该文件会生成自动电子邮件响应以注册到我的网站。
这是文件:
function simplr_send_notifications($atts, $data, $passw) {
$site = get_option('siteurl');
$name = get_option('blogname');
$user_name = @$data['username'];
$email = @$data['email'];
$notify = @$atts['notify'];
$emessage = apply_filters('simplr_email_confirmation_message');
$message = <<<EOF
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
I cut out the bulk of the template to save space...
</table>
</center>
</body>
</html>
EOF;
$headers = "From: $name" . ' <' .get_option('admin_email') .'> ' ."\r\n\\";
wp_mail($notify, "A new user registered for $name", "A new user has registered for $name.\rUsername: $user_name\r Email: $email \r",$headers);
$emessage = $emessage . "\r\r---\r";
if(!isset($data['password'])) {
$emessage .= "You should login and change your password as soon as possible.\r\r";
}
$emessage .= "Username: $user_name\r";
$emessage .= (isset($data['fbuser_id']))?'Registered with Facebook':"Password: $passw\rLogin: $site/wp-login.php";
wp_mail($data['email'],"$name - Registration Confirmation", $emessage, $headers);
任何帮助表示赞赏!谢谢。