Forums / Developer / Set template language for emailing (i18n)

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Set template language for emailing (i18n)

Author Message

David P.

Wednesday 17 September 2008 5:33:40 am

Hello,

I have a custom extension for customer relationship management. This extension send some information e-mail to customers (french or not!) when the administrative manager begin some events. She uses this extension on the "admin" siteaccess in french.
So, email sent to customer are in french!

My mail body is a template :

$tpl_mail =& templateInit();
$body  =& $tpl_mail->fetch( 'design:mailing/mailcustomer.tpl' );
$mail = new eZMail();
$mail->setBody( $body );		                              
$mailing = eZMailTransport::send( $mail );

I would like to switch regional settings to good language (customer language) before parsing my mail template witch use i18n operator.

How can I do that? How can I set the language (locale) for a good template translation with the i18n function?

Sorry for my bad english...
Thanks!