Hi,
What is the best way to make it possible to send one of two existing emails as a reply of a formsubmit. So, e.g. if a radiobutton has a value 1 --> email 1 is send, if it has the value 2 --> email 2 is send.
Kind regards, Aron.
What is the best way to make it possible to send one of two existing emails as a reply of a formsubmit. So, e.g. if a radiobutton has a value 1 --> email 1 is send, if it has the value 2 --> email 2 is send.
Kind regards, Aron.
Hi Aron,
Is this the same email to different addresses? or different email to the same address? or different emails to different addresses?
Bob
Is this the same email to different addresses? or different email to the same address? or different emails to different addresses?
Bob
This is a different email to the same address. Zo depending on what the visitor filled in the form either one of two emails is send.
Hi alinden,
I would handle that by using PHP in a Custom Code action before the email action, something like this:
You could also put the PHP in the Email template if you have the Rich text editor turned off but I prefer to separate it out.
Also, if part of the email remains the same, you can mix and match making just a part of the template variable in this way.
Bob
I would handle that by using PHP in a Custom Code action before the email action, something like this:
<?php
if ( $form->data['radiop_button_name'] == 'some_value' ) {
$email_body ="
Some text {$form->data['some_input_name']} more text . . .
";
} else {
$email_body ="
Some other text {$form->data['some_other_input_name']} some more text . . .
";
}
$form->data['email_body'] = $email_body;
?>
Then put {email_body} in the Email template.
You could also put the PHP in the Email template if you have the Rich text editor turned off but I prefer to separate it out.
Also, if part of the email remains the same, you can mix and match making just a part of the template variable in this way.
Bob
This topic is locked and no more replies can be posted.