Is it possible to use … dmx-repeat:repeat_email=“sc_staff_list.data.staff_list” {{email_address}} … inside a form input?
What I am trying to do is place the result of a dynamic repeat of email addresses inside an input $_POST.staff_email so it can be used to send an email message.
Please take a look at the code in the attached image and let me know if it can be done.
But you don’t need to do this using hidden fields on the page.
You should do this directly in the server action. Just a question before i explain you how to do this. Should the email be sent to all the guys as recipients (meaning all are listed in mail to field) or do you prefer to loop through the emails and send the same mail individually to all users?
Either way would accomplish the task. However, the loop method might be a cleaner output in the email header. I am opened to whatever you think would be the best and most efficient.
The top field is to search for the missionary; then the search query gathers all the other representatives relative to the located missionary. Then that is displayed only for verification to the person searching. The other email addresses of the staff will be hidden.
In your server action, just create a query - which gets the emails, add a repeat step after the query (which repeats the query) and in the repeat step put the send mail step.
Then bind the recipient binding in the recipient field and you are done. The repeat will be executed as many times as the records are returned from the query:
Quick question, is there no need for a database connection step prior to the query? All of the staff info resides in a table in the database.
The form provides the $_POST data for the missionary, regional director and other meeting details that will eventually populate the HTML email.
Once the submit button is clicked it initiates the action steps within your example, and sends the email to each recipient as well as each staff member.
With the Recipient(s) set to Extended, the name, and email address for the missionary will be $_POST’ed in the Recipient(s): To Name and To Email.
The regional director’s email will be placed in the Recipient(s): CC
The staff queried email list will be placed in the Recipient(s): Bcc
To me, it appears that the above steps would duplicate an email to the MS and RD? Is this correct?