Forums / Setup & design / Missing EmailSender in Email Headers

Missing EmailSender in Email Headers

Author Message

PaoloMellerio kk

Thursday 04 September 2003 9:00:32 am

Hi,
I've created a form for informations request.
In it, among the others, there is a field "Email_sender" (defined as information collector in the class used for the form).
All works fine, except the fact that I can't find the way to show the field "Email_sender" (filled by the user, while compiling the form) also in the Email Headers "FROM:".
In others words, the email which arrives, due to the form compiling, shows the content of the field "Email_sender" in the Email Header Subject, together all the other fields filled by user in the form, but not in the Email Headers Sender.
Is there a way to modify the file collectedinfomail.tpl or another way to solve this problem?

Thanks in Advice

Paolo Mellerio (Clikka!com)

Paolo Mellerio
http://www.clikka.com

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

eZ debug

Timing: Jan 19 2025 06:14:21
Script start
Timing: Jan 19 2025 06:14:21
Module start 'content'
Timing: Jan 19 2025 06:14:22
Module end 'content'
Timing: Jan 19 2025 06:14:22
Script end

Main resources:

Total runtime1.5621 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.0703180.8281
Module start 'content' 0.00691.3678 769.8984655.4922
Module end 'content' 1.37470.1874 1,425.3906341.6953
Script end 1.5621  1,767.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2609210.0002
Check MTime0.00140.0889210.0001
Mysql Total
Database connection0.00160.102410.0016
Mysqli_queries1.459393.42032040.0072
Looping result0.00210.13392020.0000
Template Total1.533598.220.7668
Template load0.00220.139520.0011
Template processing1.531398.029520.7657
Template load and register function0.00020.014410.0002
states
state_id_array0.00140.090110.0014
state_identifier_array0.00260.166720.0013
Override
Cache load0.00200.1253660.0000
Sytem overhead
Fetch class attribute can translate value0.00130.080550.0003
Fetch class attribute name0.00160.099480.0002
XML
Image XML parsing0.01420.908150.0028
class_abstraction
Instantiating content class attribute0.00000.001090.0000
General
dbfile0.01831.1710390.0005
String conversion0.00000.000230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs