Forums

mailto results based on subject?

nomi 03 Apr, 2008
Is it possible to send the results email to different email addresses based on the subject? For example, if they select in the drop down box "Marketing", then the results should go to [email]marketing@site.com[/email] or "Jobs" should go to [email]jobs@site.com[/email].

I've got the basic form set up pretty easily, but I'm having a hard time figuring out how to do this part.

Thanks!
GreyHead 03 Apr, 2008
Hi nomi,

Yes you can do that there are a few examples in the forums here. Basically you can set up a Switch statement in the OnSubmit beofer box that looks at the value of the field and sets the email accordingly.

Bob
nomi 04 Apr, 2008
Thanks, Bob. Hmmm, I guess I should have asked if this was possible to do without knowing php. I see this post, but have no idea how to apply it in this case. Is there another method besides this?

Thanks very much!
Max_admin 04 Apr, 2008
Hi nomi,

the same wya, something like this :


 <?php
switch ( $_POST['subject'] ) {
case 'value_1':
  $rows[0]->extraemail = "1@email.com";
  break

case 'value_2':
  $rows[0]->extraemail = "2@email.com";
  break

case 'value_3':
default:
 $rows[0]->extraemail = "3@email.com";
  break
}
?>


put that in the before submit box

Cheers

Max<br><br>Post edited by: admin, at: 2008/04/04 15:54
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
nomi 07 Apr, 2008
Thanks, Max. I appreciate it!!
This topic is locked and no more replies can be posted.