Email: Replacing plain text with html

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
danich
Posts: 18
Joined: 21 May 2007, 17:39

Email: Replacing plain text with html

Post by danich »

In core/email_api.php around line 745
there's a line that says :

Code: Select all

$mail->IsHTML( false );
change the value for "true" and mail will be sent in html code.
You should replace all the "\n" for "<br/>".
You can also change font, color, etc, you should start the html tag in the strings_english.txt file, more specificaly in all the "$s_email_notification_title" vars.
The tags should be closed in email_api.php, in the line where it says:

Code: Select all

$t_message .= $t_email_separator1 . " \n\n";
for example:

Code: Select all

$t_message .= $t_email_separator1 . " <br/><br/></font>";
That's it !
Mantis 1.1.0a3 @ CentOS Red Hat 3.4.6-8
Powered by Dual Opteron Dell Poweredge SC1435 =)
tetsunami
Posts: 26
Joined: 21 Apr 2010, 14:45

Re: Email: Replacing plain text with html

Post by tetsunami »

centanly this way works but viewing the source code of the sent mail i fount a tag
<td class="normal">

so im asking if theres a css style sheet in mantis for the e mail
in order to avoid the futures tag by tag change :D
dtamajon
Posts: 15
Joined: 13 Jun 2013, 23:08

Re: Email: Replacing plain text with html

Post by dtamajon »

I have moved decision to the config_inc.php file by doing:

$g_email_is_html = ON; # or OFF

And modifyng the core/email.php as you proposed, but using the config variable:

$mail->IsHTML( config_get( 'email_is_html' ) );

I hope find we can find such configuration in proper versions... when using BBCode or other formating plugin's, it's annoying receiving plain text e-mails with HTML tags.

Thanks!!!
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Email: Replacing plain text with html

Post by atrol »

Please use Search before posting and read the Manual
Post Reply