Ho un modulo personalizzato che sto provando a generare un email HTML usando la funzione drupal_mail (D7). La posta sta arrivando e mostra anche text/html, tuttavia qualcosa sembra aver rimosso l'HTMl prima che arrivi a una casella di posta.Drupal 7 drupal_mail che estrae l'HTML?
In primo luogo, in una funzione che sto costruendo il mio titolo/corpo/altri Vars e l'invio di una funzione personalizzata:
$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);
Poi ho la latch_mail funzioni 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'];
}
e
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);
}
mi aspetterei le e-mail a venire attraverso con i miei tag e tag a BR, ma si tratta thro ugh così:
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
In qualche modo si sta prendendo i miei link e trasformarli in note durante la rimozione completamente i tag br.
Qualsiasi aiuto tu possa fornire sarebbe apprezzato. Grazie!