Saturday 28 May 2011 2:43:54 pm
Hi, I've developed a new extension. In this extension I send a mail.The mail is sent correctly using my template, but the variables content doesn't display. The code of my template is this:
{'Hi '} {$name}
{'...'} When I receive mail only see this: Hi ... The part of my PHP code to construct and send the mail is this: $Ini = eZINI::instance();
$emailSender = $Ini->variable( 'MailSettings', 'EmailSender' );
$mail = new eZMail();
$Tpl = eZTemplate::factory();
$templateResult = $Tpl->fetch( 'design:info_email.tpl' );
$Tpl->setVariable( 'name', 'David' );
$subject = 'TEST';
$mail->setSender( $emailSender );
$mail->setReceiver( '[email protected]' );
$mail->setSubject( $subject );
$mail->setBody( $templateResult );
$mail->setContentType( 'text/html' );
$mailResult = eZMailTransport::send( $mail );
Any idea? Thanks, David
|