WordPress: impostare il Content-Type delle e-mail su text/html

Per impostazione predefinita tutte le e-mail inviate da WordPress tramite la funzione wp_mail() hanno come Content Type il valore text/plain. Possiamo impostare questo valore su text/html usando un semplice filtro. Vediamo come.

Aggiungete il seguente codice al file functions.php:


function set_mail_content_type(){
    return 'text/html';
}
add_filter( 'wp_mail_content_type','set_mail_content_type' );
Torna su