如何只发送没有标签的内容?
我正在使用以下代码使用 html 模板发送电子邮件。
电子邮件已发送,但在电子邮件正文中,我还获得了所有 HTML 标记(<div>、<p>.. 等等)。
$message = array();
$message['id'] = $booking_id;
$message['name'] = $order_info[0]->name;
$message['email'] = $order_info[0]->email;
$message['address'] = $order_info[0]->address;
$message['phone'] = $order_info[0]->phone;
$message['guests'] = $order_info[0]->total_guest;
$message['summary'] = $order_info[0]->summary;
$email_to = self::has_get_settings('email');
$subject = "New Booking! - Booking ID. " . $booking_id;
$from = $order_info[0]->email;
$from_name = $order_info[0]->name;
$template = file_get_contents($controller->plugin_path . 'includes/libraries/email_template.html');
foreach($message as $key => $value)
{
$template = str_replace('{{ '.$key.' }}', $value, $template);
}
$headers = 'From: ' . $from_name . '<' . $from . '>' . "\r\n";
$headers .= 'Reply-To: ' . $from_name . '<' . $from . '>';
wp_mail($email_to,
$subject,
$template,
$headers);
慕盖茨4494581
素胚勾勒不出你
慕无忌1623718