I have been looking at the loop function in triggered actions and would like to use it for sending an email to all contacts for a specified customer, I have a submission form with a field where a customer can be selected and an option to email individual contacts (have that working fine) and another dropdown that can be selected to "Email all". I have tried to create a loop with limitedsuccess by that I mean it sends the email to the selected contacts ok but sends it multiple times to the same contacts for however many records there are in the contacts table example below;
#
So say there are a total of 100 contacts in the contacts table but only 2 contacts for the selected customer those 2 contacts get the same email 100 times (not ideal!) so I am guessing some kind of counter is going to be needed to count the number of contacts for the selected customer and ensure the contact/s are only sent the email once. However, I am not very familiar with this particular function and the Caspio online help doesn't have a great deal of information on the loop function that I can find.
I am hoping someone has used it for something similar and will be willing to share how they achieved that, thanks for reading and any help will be greatly appreciated.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
Roosta
Hello all,
I have been looking at the loop function in triggered actions and would like to use it for sending an email to all contacts for a specified customer, I have a submission form with a field where a customer can be selected and an option to email individual contacts (have that working fine) and another dropdown that can be selected to "Email all". I have tried to create a loop with limited success by that I mean it sends the email to the selected contacts ok but sends it multiple times to the same contacts for however many records there are in the contacts table example below;
So say there are a total of 100 contacts in the contacts table but only 2 contacts for the selected customer those 2 contacts get the same email 100 times (not ideal!) so I am guessing some kind of counter is going to be needed to count the number of contacts for the selected customer and ensure the contact/s are only sent the email once. However, I am not very familiar with this particular function and the Caspio online help doesn't have a great deal of information on the loop function that I can find.
I am hoping someone has used it for something similar and will be willing to share how they achieved that, thanks for reading and any help will be greatly appreciated.
Kind regards,
Roosta
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.