How to output specific fields from a form in an e-mail?

Author Message

Espen R

Friday 06 January 2006 3:53:35 am

What is the syntax to output the collected information from a specific field from a form into a feedback e-mail?

I've seen the example on how to just loop through all the attributes but I need to lay out the e-mail in a special way so I need to access each individual attribute.

Any assistance would be very appreciated since I am quite new to eZ.

Esteban Rodriguez

Friday 06 January 2006 7:25:11 am

Hi Espen,

You can access the collected information in the $collection.attributes array.

To find exactly what attributes each element in this array has, you could use the following code

{section name=Attribute loop=$collection.attributes}
{$Attribute:item|attribute(show)}
{/section}

in the template for the collectedinfomail (most probably in the override/templates/collectedinfomail dir of your site design).

This will get you the list of attributes printed in the email you'll get from the information collector form.

hope it helps,

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

Espen R

Monday 16 January 2006 5:12:54 am

Thanks. Being new to eZ and also not a coder, it was a bit hard to grasp at first. After a while I found out that you can use the syntax as in the following example:

<b>{$collection.attributes[2].contentclass_attribute_name}:</b> {$collection.attributes[2].data_text|wash}<br />
<b>{$collection.attributes[3].contentclass_attribute_name}:</b> {$collection.attributes[3].data_text|wash}<br />
<b>{$collection.attributes[4].contentclass_attribute_name}:</b> {$collection.attributes[4].data_text|wash}<br />

This will list the <b>attribute names</b> of attributes number 2, 3 and 4 (actually 3, 4 and 5 since the first is 0) and then the <b>attribute contents</b> of each.

Maybe obvious to most people..

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 18 2025 16:01:02
Script start
Timing: Jan 18 2025 16:01:02
Module start 'layout'
Timing: Jan 18 2025 16:01:02
Module start 'content'
Timing: Jan 18 2025 16:01:02
Module end 'content'
Timing: Jan 18 2025 16:01:02
Script end

Main resources:

Total runtime0.0145 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.0051 589.2891152.6563
Module start 'layout' 0.00510.0028 741.945339.5078
Module start 'content' 0.00780.0047 781.453189.3984
Module end 'content' 0.01250.0020 870.851634.3047
Script end 0.0145  905.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002618.0439140.0002
Check MTime0.00128.3157140.0001
Mysql Total
Database connection0.00075.035710.0007
Mysqli_queries0.002517.063330.0008
Looping result0.00000.090310.0000
Template Total0.001611.110.0016
Template load0.00095.950610.0009
Template processing0.00075.089910.0007
Override
Cache load0.00064.188210.0006
General
dbfile0.00021.455280.0000
String conversion0.00000.047640.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