Adding "destination" attribute to feedback form class ?

Author Message

H-Works Agency

Monday 13 November 2006 4:04:22 pm

Hi all,

How can i add a "Destination" field to my feedback form class ?

Its very often usefull for companies website to allow users to choose which service they want to send the message to.

For exemple :

Attribute Type : selection
Attribute Name : Destination Service
Values : Sales -> sales@mysite.com, Marketing -> marketing@mysite.com, Direction...etc 


When submiting the form, the email would go directly to the choosen destination overriding the site.ini EmailReceiver=default@mysite.com

Thanx for help in advance.

MH

EZP is Great

Claudia Kosny

Tuesday 14 November 2006 12:43:50 pm

Hi Martin

If you check the standard template for feedback you can see that there is an option to set the email receiver here. So give your infocollection form an ezselection with all the departments as options so the users of your form can select the destination service.
Then just adapt you mail template so that the email receiver variable is set depending on whatever selection your user made.
The only problem is to get the email addresses that relate to each department.
To do that I see several options:
- set up an ini file that maps departments to their emailaddresses (that's what I would do)
- hardcode the email addresses in your mail template
- give your info collection form an additional matrix attribute that is not an info collector
where each line is a map from department to email address (might not work and is a bit confusing)

A problem with this approach is that the receiver's email address is not stored in the infocollection table but hopefully this is not to important.

Good luck

Claudia

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 04:27:22
Script start
Timing: Jan 31 2025 04:27:22
Module start 'layout'
Timing: Jan 31 2025 04:27:22
Module start 'content'
Timing: Jan 31 2025 04:27:22
Module end 'content'
Timing: Jan 31 2025 04:27:22
Script end

Main resources:

Total runtime0.0139 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.3750151.2422
Module start 'layout' 0.00470.0021 739.617236.6953
Module start 'content' 0.00690.0056 776.312590.2969
Module end 'content' 0.01250.0014 866.609429.9922
Script end 0.0139  896.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002115.4089140.0002
Check MTime0.00107.0907140.0001
Mysql Total
Database connection0.00085.609510.0008
Mysqli_queries0.002316.365530.0008
Looping result0.00000.072010.0000
Template Total0.00107.310.0010
Template load0.00085.522010.0008
Template processing0.00021.704110.0002
Override
Cache load0.00053.696210.0005
General
dbfile0.001813.281380.0002
String conversion0.00000.044640.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