Share » Forums » Setup & design » Missing EmailSender in Email Headers

Missing EmailSender in Email Headers

Missing EmailSender in Email Headers

Thursday 04 September 2003 9:00:32 am - 4 replies

Author Message

John Green

Friday 05 September 2003 3:00:33 am

Hi Paolo

I did this by making the following changes to
/kernel/content/collectinformation.php
(my added lines marked)

$subject =& $tpl->variable( 'subject' );
$receiver =& $tpl->variable( 'email_receiver' );
>>>> $sender =& $tpl->variable( 'email_sender' );
$redirectToNodeID =& $tpl->variable( 'redirect_to_node_id' );

$ini =& eZINI::instance();
$mail = new eZMail();

if ( !$mail->validate( $receiver ) )
{
// receiver does not contain a valid email address, get the default one
$receiver = $ini->variable( "InformationCollectionSettings", "EmailReceiver" );
}
$mail->setReceiver( $receiver );
>>>> if ( !$mail->validate( $sender ) )
>>>> {
>>>> // sender does not contain a valid email address, get the default one
>>>> $sender = $ini->variable( "InformationCollectionSettings", "EmailSender" );
>>>> }
>>>>
>>>> $mail->setSender( $sender );
$mail->setSubject( $subject );
$mail->setBody( $templateResult );
$mailResult = eZMailTransport::send( $mail );

Replace 'email_sender' with whatever name you used in the set-block in collectedinfomail.tpl

Good luck

PaoloMellerio kk

Friday 05 September 2003 5:44:16 am

Thanks John,
I've followed your suggestion, and now the email arrives with the correct email header (paolo@clikka.com) specified in the collectedinfomail.tpl:

{set-block scope=root variable=email_sender}paolo@clikka.com{/set-block}

The following step would be to find a way to modify the lines above of the collectedinfomail.tpl to read the email inserted from the user while compiling the form (in the form field "Email_sender") and to have it directly transferred in the Email Headers "FROM:" replacing the "static" value paolo@clikka.com.

Any idea?

Thanks again.

Paolo Mellerio (Clikka!com)

Paolo Mellerio
http://www.clikka.com

Graham Tillotson

Friday 05 September 2003 10:52:01 am

This works great -- thanks much. In my case I substituted the following line in collectedinfomail.tpl:

{set-block scope=root variable=email_sender}{$object.data_map.email_sender.content}{/set-block}

If I have an email address (email_sender) in the form data then I use it. If not, I pick up the default one from the InformationCollectionSettings block.

DUO : CONSULTING
Web content management experts
www.duoconsulting.com

Christian Lundvang

Tuesday 20 April 2004 12:20:24 am

If you want to send a copy or a blind copy use the following:

Blind copy:

$mail->addBcc( $receiver );


Copy:

$mail->addCc( $receiver );

Best Regards,

Christian Lundvang
Nexus Consulting as

--
Best Regards
Christian Lundvang
http://www.nxc.no

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

36 542 Users on board!

Forums menu