Share » Forums » General » Sending mail from template

Sending mail from template

Sending mail from template

Thursday 07 July 2005 2:02:35 am - 3 replies

Author Message

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

Philip K.

Tuesday 12 September 2006 3:28:00 am

Thanks a lot, I will try this.

Linux is like a wigwam; no windows, now gates, and apache inside!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu