Tick Box Emails

benny 24 Sep, 2008
Hey

I was wondering if this is possible, having tickboxes at the end of the form that when you choose one it will send the form to that person.
eg. fill for out, has 3 tickbox at the end, ones admin, ones manager, ones recepionist. you tick the one you want to send the email to.

Not sure if possible but just wanted to know.

Thanks
GreyHead 24 Sep, 2008
Hi Benny,

It's certainly possible with some PHP in the OnSubmit before box. Basically you'd look up the addresses in some kind of table and add them to the email to or ccemail entries.

Bob
benny 24 Sep, 2008
Thanks for the reply.

Not so good at php😛

Can you give me any examples?
Max_admin 24 Sep, 2008
Hi Benny, which Chronoforms version do you have installed ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
benny 25 Sep, 2008
Hey Max

V3.0 beta 2 using joomla 1.5.6
Max_admin 25 Sep, 2008
Hi Benny,

first this code is for V3.0 stable, I think it will work with beta 2
assuming the 3 boxes has 3 different names box1,box2,box3 and that you have some TO email setup on this email and its the first email in the list of emails setup!

at the onsubmit before code box add this :


if(JRequest::getVar('box1'))$emails[0]->to .= ',manager1@domain.com';
if(JRequest::getVar('box2'))$emails[0]->to .= ',manager2@domain.com';
if(JRequest::getVar('box3'))$emails[0]->to .= ',manager3@domain.com';


however if you have a radio button group which will select one button only :


if(JRequest::getVar('box1'))$emails[0]->to .= ',manager1@domain.com';


Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
benny 25 Sep, 2008
So i have to add all the emails i want, in the email to field in email setup?
Max_admin 25 Sep, 2008
lets simplify it, create one email only and at the TO field add "youremail@yourdomian.com" then enable the email and add my code below and save and test!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
benny 26 Sep, 2008
Got it working🙂 thanks for the help Max and Bob

Always provide fast help🙂
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger