Dears,
I have using roundcube 0.2 beta in
production environment and works fine.
I did a couple of small changes to
customize for our needs, I’d like to share.
Here’s one.
I used $rcmail_config['generic_message_footerl']
= 'disclaimer.html'; as a disclaimer but the problem is that the text only
mails were with html codes.
So, I modified the config to:
$rcmail_config['generic_message_footer_html']
= 'disclaimer.html';
$rcmail_config['generic_message_footer_txt']
= 'disclaimer.txt';
Then I changed the file: program/steps/mail/sendmail.inc
I removed the original line as:
if (!$savedraft &&
!empty($CONFIG['generic_message_footer']) && ($footer =
file_get_contents(realpath($CONFIG['generic_message_footer']))))
$message_body .=
"\r\n" . rcube_charset_convert($footer, 'UTF-8', $message_charset);
And added it right below:
if ($isHtml)
{ # MOD START
if (!$savedraft &&
!empty($CONFIG['generic_message_footer_html']) && ($footer =
file_get_contents(realpath($CONFIG['generic_message_footer_html']))))
$message_body .=
"\r\n" . rcube_charset_convert($footer, 'UTF-8', $message_charset);
# MOD END
$MAIL_MIME->setHTMLBody($message_body);
// add a plain text version of the e-mail
as an alternative part.
$h2t = new html2text($message_body);
$plainTextPart =
wordwrap($h2t->get_text(), 998, "\r\n", true);
if (!strlen($plainTextPart))
{
// empty message body breaks attachment
handling in drafts
$plainTextPart = "\r\n";
}
$MAIL_MIME->setTXTBody(html_entity_decode($plainTextPart, ENT_COMPAT,
'utf-8'));
// look for "emoticon" images
from TinyMCE and copy into message as attachments
rcmail_attach_emoticons($MAIL_MIME);
}
else
{
# MOD START
if (!$savedraft &&
!empty($CONFIG['generic_message_footer_txt']) && ($footer =
file_get_contents(realpath($CONFIG['generic_message_footer_txt']))))
$message_body .= "\r\n"
. rcube_charset_convert($footer, 'UTF-8', $message_charset);
# MOD END
Hope it helps someone. Maybe it would be
usefull to be included in next release.
Thanks in advnce.
Jonathan Araújo
Administrador de
Infra-estrutura de TI
Gerência de TI - INDG S.A.