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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:30:49
Script start
Timing: Jan 31 2025 01:30:49
Module start 'layout'
Timing: Jan 31 2025 01:30:49
Module start 'content'
Timing: Jan 31 2025 01:30:49
Module end 'content'
Timing: Jan 31 2025 01:30:49
Script end

Main resources:

Total runtime0.0268 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.3906151.2422
Module start 'layout' 0.00690.0037 739.6328220.7500
Module start 'content' 0.01060.0146 960.3828997.9922
Module end 'content' 0.02520.0015 1,958.375033.9922
Script end 0.0267  1,992.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002810.2952140.0002
Check MTime0.00114.2824140.0001
Mysql Total
Database connection0.00083.173310.0008
Mysqli_queries0.00217.955930.0007
Looping result0.00000.052510.0000
Template Total0.00114.010.0011
Template load0.00093.184910.0009
Template processing0.00020.772610.0002
Override
Cache load0.00051.968110.0005
General
dbfile0.00238.762480.0003
String conversion0.00000.038340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs