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!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:36:04
Script start
Timing: Jan 18 2025 19:36:04
Module start 'layout'
Timing: Jan 18 2025 19:36:04
Module start 'content'
Timing: Jan 18 2025 19:36:04
Module end 'content'
Timing: Jan 18 2025 19:36:04
Script end

Main resources:

Total runtime0.0138 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.0313152.6406
Module start 'layout' 0.00470.0026 740.671939.4766
Module start 'content' 0.00730.0047 780.148485.3828
Module end 'content' 0.01210.0017 865.531330.3047
Script end 0.0138  895.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002518.1268140.0002
Check MTime0.00117.7790140.0001
Mysql Total
Database connection0.00074.800510.0007
Mysqli_queries0.002316.342830.0008
Looping result0.00000.079510.0000
Template Total0.00139.810.0013
Template load0.00085.511010.0008
Template processing0.00064.103910.0006
Override
Cache load0.00053.937910.0005
General
dbfile0.00021.531680.0000
String conversion0.00000.055340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs