Forums / General / Sending mail from template
François Xavier Lacroix
Thursday 07 July 2005 2:02:35 am
is there an ez way to send a mail with a special template operator ?thx.
Philip K.
Tuesday 12 September 2006 2:21:04 am
I'm interested, too...Is there a way to send a mail out of a template?
Linux is like a wigwam; no windows, now gates, and apache inside!
Norman Leutner
Tuesday 12 September 2006 3:13:54 am
You can simply create your own template operator which sends mail to a given mailadress...
The code should look something like:
include_once( 'lib/ezutils/classes/ezmail.php' ); include_once( 'lib/ezutils/classes/ezmailtransport.php' ); $mail = new eZMail(); $mail->setSender( $emailSender ); $receiver = $currentUser->attribute( 'email' ); $mail->setReceiver( $receiver); $mail->addBcc( $bccreceiver, $name = false ); $subject = "SUBJECT: BLABLA"; $mail->setSubject( $subject ); $mail->setBody( $templateResult ); $mailResult = eZMailTransport::send( $mail );
Take a look at the contributions to have some template operator examples...
Mit freundlichen Grüßen Best regards Norman Leutner ____________________________________________________________ eZ Publish Platinum Partner - http://www.all2e.com http://ez.no/partners/worldwide_partners/all2e_gmbh
Tuesday 12 September 2006 3:28:00 am
Thanks a lot, I will try this.