Text Value - different confirmation mail

Send different confirmation emails based on a form selection.

Overview

The issue was using incorrect PHP syntax to check the form field value in the CF email template.
Use the correct PHP syntax to check the form data array, then conditionally output the appropriate email content.

Answered
Th ThiloH 06 Aug, 2014
Hello,
i have in my form a field for the salutation Mr and Mrs. Depending on what was chosen a different confirmation mail should be sent.
I have a bit of PHP and the Event Switcher tried but unfortunately still no success.

In the Email Template i have tried
<?php
if({drp_salutation} =='Herr'){
    echo "Sehr geehrter Herr"; 
}
else 
{
 echo "Sehr geehrte Frau"; 
}
?>


Thanks for your help!
Thilo
Th ThiloH 08 Aug, 2014
Answer
I have my solution lightbulb

The right way was to add this code to the email template.

<?php
if( isset($form->data['drp_salutation']) && $form->data['drp_salutation'] == 'Herr' ) {
echo '<tr><td></td><td>hello world!</td></tr>';
}else{
echo '<tr><td></td><td>hello duck!</td></tr>';
}
?>
This topic is locked and no more replies can be posted.