Forums

Different e-Mail address based on form entries

rosemeyer2 13 Oct, 2008
Hi,

I have a form in J1.5 which has a country combobox. Based on the country the users chooses I would like to send the e-Mail to a different e-Mail address. So our guys in germany should get the e-Mail, if someone chooses germany in the form. Seems to me, that I have to put in some php, but where?

Thanks and regards,

Rudolf
GreyHead 13 Oct, 2008
Hi Rudolf,

Please see FAQ 32 - I think that's what you need.

Bob
rosemeyer2 13 Oct, 2008
Thanks for your quick answer, but faq 32 seems not to be the right one, which one did you mean?

Thanks and regards,
Rudolf
Max_admin 13 Oct, 2008
H Rudolf,

at the onsubmit before email try this :


<?php
if(JRequest::getVar('combobox') == 'germany')$emails[0]->to = 'germanguys@domain.com';
?>



Cheers,

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 13 Oct, 2008
Hi Rudolf,

Sorry, it's FAQ 31 "How can I safely show a list of e-mail addresses?"

Bob
rosemeyer2 14 Oct, 2008
Hi Bob,

I tried this, but no extra e-Mail is sent. I checked the sourcecode and can't find the codeblock which sends the extra e-Mail, maybe that's why it doesn't work? I checked uploadandemail() method in chronocontact.php

Thanks, Rudolf
GreyHead 14 Oct, 2008
Hi Rudolf,

Ah . . . Max has probably changed the code in v3.0, sorry I'm out of date . . .

The code is $email->to for the static email and $email->dto for the dynamic field, see the code around line 432 in chronocontact.php

Bob
rosemeyer2 14 Oct, 2008
Ok, thanks, I will add my e-Mail adresses to the ->to value.

Thanks and best regards,
Rudolf
Max_admin 14 Oct, 2008
Hi Rudolf,

did you try my snippet above ? it should do what you need assuming you have the dropdown and at least one email setup and nebaled regardless of the TO emails of it.

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
rosemeyer2 15 Oct, 2008
Hi,

I didn't have time to try it out, but I am pretty sure, that this will work. I will come back once I tried it.

Thanks for your great support.

Best regards,
Rudolf
This topic is locked and no more replies can be posted.