Forums

Problem with my e-mail template

Lodeke87 02 Feb, 2014
Hello

This is my form: http://www.ljdesign.be/offerte

When you choose a project, the other options become hidden... but when I receive my email, i still see the hidden labels in the e-mail ...

For example: when i choose website as project, the options grafisch werk and sociale media must be empty or hidden ... This is the email ...

Voornaam: Lode
Naam: ******
Adres: *****
Postcode: ****
Gemeente: *****
Telefoon: *****
E-mail: *******
Project: Website
Website: Meer dan 10 pagina's
Grafisch werk: Bedrukken kledij
Sociale media: Facebook
Details project: Test

This is my e-mail template:

Voornaam: {voornaam}
Naam: {naam}
Adres: {adres}
Postcode: {postcode}
Gemeente: {gemeente}
Telefoon: {telefoon}
E-mail: {email}
Project: {dropdown24}
Website: {dropdown17}
Grafisch werk: {dropdown20}
Sociale media: {dropdown21}
Details project: {textarea15}

Does anyone know the answer to my question?

Thx very much!!!
GreyHead 03 Feb, 2014
Hi Lodeke87,

The answer is to add PHP to your Email template to make it dynamic and show just the elements that you want shown.

You can add PHP directly to the Email template box provided that you keep the Rich Text Editor turned off.

Or you can build the template in a Custom Code action before the Email action, save the results to the $form->data array and add the results to the template something like this:
<?php
$form->data['email_template'] = // some code
?>
then put {email_template} in the Email template box.

Bob
Lodeke87 06 Feb, 2014
Can someone help me with that?
This topic is locked and no more replies can be posted.