1
plusangel
Mail templates and encoding issues
  • 2005/7/15 11:08

  • plusangel

  • Just popping in

  • Posts: 90

  • Since: 2005/2/2 1


I’ve found the welcome message that the registered users receive (with the activation link) is inside the language\greek\mail_template\.

Inside the file register.tpl there is a welcome message in greek. In order to display the message in greek, I edited the register.php file by adding the:

$xoopsMailer->addHeaders('Content-Type: text/html; charset=ISO-8859-7');

Inside this if statement

if ($xoopsConfigUser['activation_type'] == 0) {
$xoopsMailer =& getMailer();
$xoopsMailer->addHeaders('Content-Type: text/html; charset=ISO-8859-7');
$xoopsMailer->useMail();
$xoopsMailer->setTemplate('register.tpl');
$xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
$xoopsMailer->assign('SITEURL', XOOPS_URL."/");
$xoopsMailer->setToUsers(new XoopsUser($newid));
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
if ( !$xoopsMailer->send() ) {
echo _US_YOURREGMAILNG;
} else {
echo _US_YOURREGISTERED;
}

Everything worked fine expect the subject of the email…this is still not readable!
Any ideas how can manipulate the encoding of the subject?
The official greek support site for xoops

2
kaotik
Re: Mail templates and encoding issues
  • 2005/7/15 12:26

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


I could be wrong, but I think that's not the prefered method of doing it. the mail template should be retrieved by $xoopsConfig['language'] from you module language folder.

As such you should use this instead:
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/your_module/".$xoopsConfig['language']."/mail_template/");
$xoopsMailer->setTemplate('your_mail_template.tpl');
www.kaotik.biz

Login

Who's Online

261 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 261


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits