Forums

Dynamic Email does not seem to work

superdmon 03 Feb, 2014
I'm loving Chronoforms V5, however, have run into an issue. First I can no longer find how or where to set Dynamic CC or BCC. I do see the Dynamic To field is still there.

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!
calculus00 03 Feb, 2014
Hello superdmon,
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😉
superdmon 03 Feb, 2014
Thanks automated system, but I do not think that helps me. :-)
Max_admin 04 Feb, 2014
Hello superdmon,

Please try with only 1 recipient, does it work ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
superdmon 04 Feb, 2014

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
superdmon 04 Feb, 2014
The answer is yes, if I pass just one dynamic email address to the field it works. Do you think there is something wrong with passing comma delimited emails to that field? Is there anyway to pass them as a CC or BCC?

SuperD
superdmon 04 Feb, 2014
It looks like the issue is passing a comma delimited group of emails to a dynamic variable. Chronoforms does not seem to know what to do with that I suppose. :-( I wish you could pass an array to a Dynamic To:

Hello superdmon,

Please try with only 1 recipient, does it work ?

Regards,
Max

Max_admin 04 Feb, 2014
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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
superdmon 05 Feb, 2014
No dice on that either. Yes, it's definitely a bug of some sort.
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

Max_admin 05 Feb, 2014
Weird, so if you pass an array of emails addresses it also doesn't work ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
superdmon 06 Feb, 2014
That is correct. I did a work around where each email had it's own dynamic variable. I then passed all dynamic variables to the Dynamic To field like so:

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 ?

This topic is locked and no more replies can be posted.