Forums / Setup & design / Sending two or more different emails after form submission

Sending two or more different emails after form submission

Author Message

Espen R

Tuesday 09 December 2008 12:49:05 pm

How can I make so that 2 different emails are sent after a user submits a form?

Both will use variables from the input. One is the order confirmation email to the user and the other is the actual order. I would like these to have different formating.

Christian Rößler

Monday 15 December 2008 9:02:19 am

Espen,

have you managed to get this working?
I'm currently in the exact same situation and would like to know if you had any success...

cheers,
Christian

Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613

source pixel

Monday 15 December 2008 10:40:54 am

Hello
Maybe this help

1. add two email attribute to "form class" (id of the attribute "email_one", "email_two")
2. override the template "/content/collectedinfomail/form.tpl" and then add this code

send to first email
{set-block scope=root variable=email_receiver}{$object.data_map.email_one.content}{/set-block}

send to second email
{append-block scope=root variable=email_cc_receivers}{$object.data_map.email_two.content}{/append-block}

<b>Or without class change</b>
1. override the template "/content/collectedinfomail/form.tpl" and then add this code

{set-block scope=root variable=email_receiver}Enter_you_first_email_address@ez.no{/set-block}

send to second email
{append-block scope=root variable=email_cc_receivers}Enter_you_second_email_address@ez.no{/append-block}

Ben Ryan

Monday 15 December 2008 3:17:55 pm

The above code doesn't do what Espen was after. I believe you are still sending the exact same email to two different people (using to and CC). But Espen is after a template for each email. So both emails have different contents in it. I'm after the same functionality.

Does anyone know how to do this, apart from writing your own extension.

Cheers

eZ debug

Timing: Jan 18 2025 11:20:43
Script start
Timing: Jan 18 2025 11:20:43
Module start 'content'
Timing: Jan 18 2025 11:20:44
Module end 'content'
Timing: Jan 18 2025 11:20:44
Script end

Main resources:

Total runtime0.9659 sec
Peak memory usage4,096.0000 KB
Database Queries201

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 587.9688180.7969
Module start 'content' 0.00910.8041 768.7656616.7266
Module end 'content' 0.81330.1526 1,385.4922333.3359
Script end 0.9658  1,718.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.4649210.0002
Check MTime0.00150.1595210.0001
Mysql Total
Database connection0.00100.104210.0010
Mysqli_queries0.875290.60542010.0044
Looping result0.00240.24681990.0000
Template Total0.931396.420.4657
Template load0.00230.234720.0011
Template processing0.929196.181420.4645
Template load and register function0.00020.022810.0002
states
state_id_array0.00080.080910.0008
state_identifier_array0.00190.201520.0010
Override
Cache load0.00190.1998250.0001
Sytem overhead
Fetch class attribute can translate value0.00270.277950.0005
Fetch class attribute name0.00180.186850.0004
XML
Image XML parsing0.00710.737150.0014
class_abstraction
Instantiating content class attribute0.00000.001250.0000
General
dbfile0.01261.3092270.0005
String conversion0.00000.000930.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs