Tengo un módulo personalizado que estoy tratando de generar un correo electrónico HTML utilizando la función drupal_mail (D7). El correo está llegando e incluso muestra texto/html, sin embargo, algo parece estar eliminando el HTMl antes de que llegue a la bandeja de entrada.Drupal 7 drupal_mail eliminando HTML?
En primer lugar, en una función que estoy construyendo mi título/cuerpo/otros VARs y enviar a una función personalizada:
$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);
entonces tengo las funciones latch_send_email latch_mail:
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'];
}
y
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);
}
Espero que los correos electrónicos lleguen con mis etiquetas a y br, pero vienen a través de uf así:
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
De alguna manera se está tomando mis enlaces y convertirlos en notas al pie, mientras que la eliminación de las etiquetas br completo.
Cualquier ayuda que pueda proporcionar sería apreciada. ¡Gracias!