Forums

More than 3 E-Mails to more than 3 Admins?

galbur 29 May, 2013
Hi

I have a form with a dropdown with 7 entries. (value1, value2, value3 etc.)
Now i need to send 7 different E-Mails depending on the value from the drop-down.
I worked with the Event-Switcher [GH]. This works only for 3 events. Is there an other possibility to implement that?

Thank you in advance
galbur 31 May, 2013
Hi Bob

Thanks a lot for your Help.
I tried this but until now with no fortune.

Ok, i used a dropdwon-element with the name "lets_try" and the id "lets_try"
and the following values:


em1=value1
em2=value2
em3=value3
em4=value4
etc. 


In the on submit Box i had a custom-code with the follwing:

<?php
$recipient = JRequest::getString('lets_try','em1','post');
$emails = array (
  'em1' => 'test+01@gmail.com',
  'em2' => 'test+02@gmail.com',
  'em3' => 'test+03@gmail.com', 
  'em4' => 'test+04@gmail.com',
  'em5' => 'test+05@gmail.com',
  'em6' => 'test+06@gmail.com',
  'em7' => 'test+07@gmail.com', 
  'em8' => 'test+08@gmail.com'
);
$form->data['email_to_use'] = $emails[$recipient];
?>


Then i put "email_to_use" in the dynamic to-field of an email-action.
When i use the Form, everything works but i always get an e-mail to "test+01@gmail.com" wether i choose "em1", "em2" or "em3"..

Thanky you in advance
Chris
galbur 31 May, 2013
Hi Bob

Sorry, false alarm. I did a mistake with the name-field. Now everything works perfect!
Thank you anyway.

Chris
dylis 23 Jan, 2014
Hi

I've tried this method with chronoform v5, with half success.

I used a checkbox group for each email, and if I check only one box, everything works fine, but, if I check more than one box, the email is only sent to the last one of the box ? (I've tried with dropdown to, allowing multiple select, the result is the same)

any clue please ?
GreyHead 23 Jan, 2014
HI dylis,

This is one for Max I'm afraid; I don't know if the CFv5 Email action will support an array or a list of To Email addresses. I don know that it is possible in CFv4.

Bob
dylis 23 Jan, 2014
that was fast thanks,

I wonder then, I've seen recently (cant find the post again), a process to create a checkbox so the user can chose to receive or not the submited form by mail.

This process wa to create a checkbox, an email action disabled by default, and then a custom code to enable the email action when box checked.
Could I repeat this process more than once to my purpose ?
This topic is locked and no more replies can be posted.