Forums

Choose recipient from drop down menu - revisited

highrockmedia 21 Nov, 2008
I am using Chronoforms 2.3 with Joomla 1.0.12 and I get the concept that is on this page:

http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=6567&p=6730

The only thing I don't understand is that under the general tab, I am not sure what to put for:

Email the results ?
Email Address(es):

-- they are required fields and I am using the PHP code in the "On Submit code - before sending email: (PHP code with tags)" to send to an email based on what is selected from the drop down menu on my page.

Any suggestions?
GreyHead 21 Nov, 2008
Hi Brewster,

You need to say 'Yes' to 'Email the results' or the OnSubmit before code will not execute.

Put a dummy email address on the other field [email]'user@example.com[/email]' is OK.

Bob
highrockmedia 21 Nov, 2008
Ok, yes that works, I actually decided to put in my "noreply@" for the fake address.

Also is there anyway of getting my drop down choices to be the subject line as well?

so right now my working form code is:

HTML

 <select name="Who" id="Who" class="align">
<option value = "nowhere" selected="selected">Choose a Subject</option>
<option value="Partnerships">Partnerships</option>
<option value="Media inquiries">Media inquiries</option>
<option value="Advertising">Advertising</option>
</select>   


and my PHP code on submit (before email sent) is:


<?php

$emails = array(
'Partnerships' => 'email1@domain.com',
'Media inquiries' => 'email2@domain.com',
'Advertising' => 'email3@domain.com');
$rows[0]->extraemail .= ", ".$emails[$_POST[Who]];

?>


so basically I want whatever choice is selected to also be the subject line in the email

thanks.

EDIT:

I figured it out, all i needed to do was to put "Who" under subject in special fields.
GreyHead 21 Nov, 2008
Hi brewster,

You can set use
<?php
$rows[0]->emailsubject = "xxx";
?>
to setyour choice of subject in the same way as the email address.

Bob
highrockmedia 21 Nov, 2008
thanks, we must have posted at the same time, I think its just easier to use the special fields option. It picks up that variable called "Who"
This topic is locked and no more replies can be posted.