我有一個自定義模塊,我試圖使用drupal_mail函數(D7)生成HTML電子郵件。郵件即將通過,甚至顯示文本/ HTML,但某些地方似乎在收到郵箱之前剝離了HTMl。Drupal 7 drupal_mail剝離HTML?
首先,在功能我建立我的標題/體/其他增值經銷商和發送自定義函數:
$body = "We thought you'd like to know that ".$fullname." has marked your project as completed.
<br /><br />
Please visit the link at <a href='http://".$_SERVER['HTTP_HOST']."/survey/customer/".$customer[0]->unique_id."'>http://".$_SERVER['HTTP_HOST']."/survey/customer/".$customer[0]->unique_id."</a> to take the survey.";
$returnMail = latch_send_mail('pro_realized',$customer[0]->customer_email,$user->mail,$title,$body);
然後我有latch_mail latch_send_email功能:
function latch_mail($key, &$message, $params) {
$headers = array(
'MIME-Version' => '1.0',
'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
'Content-Transfer-Encoding' => '8Bit',
'X-Mailer' => 'Drupal'
);
foreach ($headers as $key => $value) {
$message['headers'][$key] = $value;
}
$message['body'][] = $params['body'];
$message['subject'] = $params['subject'];
}
和
function latch_send_mail($key,$to,$from,$title,$body,$headers='') {
$params['body']=$body;
$params['subject'] = t($title);
return drupal_mail('latch', $key, $to, language_default(), $params, $from,TRUE);
}
我希望電子郵件通過我的一個標籤和br標籤,但它來thro呃像這樣:
We thought you'd like to know that John Doe has marked your project as completed. Please visit the link at http://latch.local/survey/customer/34c91b8883cd70b32c65feb7adf9c393 [1] to take the survey. [1] http://latch.local/survey/customer/34c91b8883cd70b32c65feb7adf9c393
不知何故,它採取我的鏈接,並把它們變成腳註,同時完全刪除br標籤。
任何幫助,您可以提供將不勝感激。謝謝!