Placeholder of repeating element

jeanl

Member
Hi

I am busy making an email template for when a form is submitted. I have some repeating data and would like to ask if anyone can help me. I have the template completed, with {placeholders} but the data does not display correctly.
 
Define "not display correctly"?

Typically, an element which is repeated will display as a UL (unnumbered list).

Placeholders really aren't very good for repeat data. It's usually best to write a PHP template if you need to deal with repeat groups, and access the $emailData[] array directly.

-- hugh
 
Hello Hugh

Thanks for replying. As an example, I have a purchase order that I complete online and would like to email it to the supplier. The data I have available to select the items I order, is in a repeating group, so when I submit the form (html template with placeholders), the data in the email body is a comma seperated list, and not displayed in seperate lines.

Jean
 
Yup. I mis-spoke, it doesn't replace with a UL, it does just do comma separation. Placeholders were never really designed for repeated data.

You'll need to write a little PHP template to properly format repeat data. The wiki and the examples in ./plugins/fabrik_form/email/scripts give you a rough idea.

To format a repeat element in as (say) separate lines ...

Code:
<?php

foreach ($this->emailData['yourtable___yourelement'] as $thisValue) {
   echo $thisValue . "<br />"
}

If you want to Skype me I don't mind giving you a little help, to get you going.

-- hugh
 
Hello Hugh

Thank you very much. I appreciate it. Let me do the basic template/php, see what it spits out, and then I will make contact over Skype.

Thanks, Jean.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top