I have a form where depending on what people check it creates an array of email addresses. I process this through custom code using the On Submit. Everything with my emails looks good on the debug.
I'm adding the emails to a new form data field like so:
$dyn_email = implode(",",array_keys($emails));
$form->data['dyn_email'] = $dyn_email;
I've tried adding "dyn_email" to the Dynamic To field but I'm not getting any emails and I'm getting an error stating
Mailer Error: You must provide at least one recipient email address.
Here is what debug says:
[Email] => Array
(
[0] => An email with the details below could NOT be sent:
[1] => To:user1@site.com,user2@site.com,user3@site.com,user4@site.com
[2] => Subject:Inquiry
[3] => From name:Joe Blow
[4] => From email:joe@blow.com
[5] => Reply name:Joe Blow
[6] => Reply email:joe@blow.com
[7] => Attachments:
[8] => Body:
<h1>Inquiry</h1>... the rest of my html
Everything looks good, but says the email can not be sent. Not sure why.
Thanks for any/all help!
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How to send an Email dynamically
P.S: I'm just an automated service😉
Please try with only 1 recipient, does it work ?
Regards,
Max
Hello superdmon,
Please try with only 1 recipient, does it work ?
Regards,
Max
Hi Max. If I use just the static To: recipient field it works fine. Are you suggesting that I pass only one dynamic email address to the dynamic To: field? I can try that as well.
Charles
SuperD
Hello superdmon,
Please try with only 1 recipient, does it work ?
Regards,
Max
There is of course some glitch to be fixed, but I'm trying to help you getting it working soon!
Regards,
Max
I think I know another work around to get it to function. I'll just create a dynamic variable for each email I need and have them all set to empty. If conditions on the form is met, then I'll populate them. I'll put them all in the Dynamic To variable. Obviously the system will ignore the blank ones.
Ok, please change your code in the first post, simply don't implode the list of emails, just pass them directly to the data field, does this work ?
There is of course some glitch to be fixed, but I'm trying to help you getting it working soon!
Regards,
Max
dyn_email1,dyn_email2,dyn_email3,dyn_email4,dyn_email5,dyn_email6,dyn_email6
... so on and so forth and what have you... :-)
If one is empty it didn't really matter, the email routine seems to just ignore that, but it did allow the others to get passed on. Obviously this is not the optimum solution, it would be nice if a comma delimited list worked, or even an array of email addresses.
Weird, so if you pass an array of emails addresses it also doesn't work ?
