Hi,
I have a form with a multiplier container that has the email of author
with the array, I save this information in a specific DB
It's possible to send an email to each user? I think that I set up a handle of array.. but it doesn't work.
Anybody can help me?
I have a form with a multiplier container that has the email of author
with the array, I save this information in a specific DB
[autori] => Array
(
[1] => Array
(
[record_id] => 131
[autoriemail] => dfdfdf@f.it
)
[2] => Array
(
[record_id] => 131
[autoriemail] => hhhhh@hljk.it
)
[id] => 58
)
It's possible to send an email to each user? I think that I set up a handle of array.. but it doesn't work.
Anybody can help me?
Hi livingwebstudio,
Please try this in a Custom Code element before the Email action
Bob
Please try this in a Custom Code element before the Email action
<?php
$form->data['autori_email'] = array();
foreach ( $form->data['autori'] as $a ) {
$form->data['autori_email'][] = $a['autoriemail'];
}
?>
Then put autori_email in the Dynamic To Email box, I think that will accept an array.
Bob
thanks a lot for your php code.. it's great!
Unfortunately email action doesn't accept array data; I have to handle array "autori_email" (with a specific action) and it works. this is the code:
Unfortunately email action doesn't accept array data; I have to handle array "autori_email" (with a specific action) and it works. this is the code:
[autori_email] => ghghgh@kkl.it,ghghdgh@kkl.it,ghghgh@kkl.it6
[Email] => Array
(
[0] => An email with the details below was sent successfully:
[1] => To:
[2] => Subject:
[3] => From name:gfgfgfg
[4] => From email:ffgfgg@hoho.iu
[5] => CC:
[6] => BCC:ghghgh@kkl.it, ghghdgh@kkl.it, ghghgh@kkl.it6
[7] => Reply name:
[8] => Reply email:
[9] => Attachments:
[10] => Array
(
)
[11] => Body:
fgfgfgfg
Hi livingwebstudio,
You can alter my code to build a comma separated list
Bob
You can alter my code to build a comma separated list
<?php
$form->data['autori_email'] = array();
foreach ( $form->data['autori'] as $a ) {
$form->data['autori_email'][] = $a['autoriemail'];
}
$form->data['autori_email'] = implode(',', $form->data['autori_email']);
?>
Bob
This topic is locked and no more replies can be posted.