How to send email if DropDown item is selected

Ringette08 27 Aug, 2013
I'm trying to send an e-mail in the CC field to a person based upon the item that is selected in a dropbox.

If a specfic item is selected I need to have the email sent to a second person otherwise the CC field is left blank.

I added a Custom Code before the EMAIL in the On Submit section of the form.

The PHP code is as follows: (I took this from an earlier post)

<?php
$form->data['cc-email'] = '';
if ( isset($form->data['checkbox_name']) && $form->data['checkbox_name'] ) {
$form->data['cc_email'] = [email]'some_email@address.com[/email]';
}
?>

I replaced the first checkbox_name with the name of my Dropbox
and the second checkbox_name with the value I'm looking for.

The [email]some_email@address.com[/email] was replaced with my e-mail.

I then placed {cc_mail} into the CC field of my form..

This doesn't seem to work.

I'm guessing I need different PHP code for a DropBox.

Can anyone assist?

Kevin
GreyHead 28 Aug, 2013
Hi Kevin,

I've just replied to the other copy of this post. Please do not double-post in the forums.

Bob
This topic is locked and no more replies can be posted.