I want to send a single email to all the email recipients. I have a workflow that pulls the entitlements metadata of an identity from a specific source.
I used the search API and filtered the source and type as Entitlement, then sent the entitlement ID in a loop to fetch the entitlement metadata. Now, the metadata contains email addresses, and there can be hundreds of entitlements for a user in a specific source. I want to send just a single email to all those hundreds of people.
Is there a way I can achieve that? If I use the “send email” action inside the loop, it will send an email individually to each recipient for each loop execution. I don’t want that. Also, the email addresses obtained in the loop are not distinct.
Is there a way to store the email addresses in the loop and use that list as recipients outside the loop to send a single email?
Have you tried defining variable and concatenate string (with email from entitlement metadata). You may need to introduce one more loop for each entitlement-metadata parsing to pick the email and put it in a single variable.
“I checked that possibility as well. The “Add Variable” has no option to save the value inside the loop, and hence it doesn’t store values in the loop as an array. It lacks the capability to concatenate the current value with the previous value and store them as a list/array. Additionally, I don’t think the ‘Send Email’ function has the capability to parse an array in the sender list.”
Have you given any thought about external trigger where you can use PowerShell script /Java code? It can be easily achieved as you can have complex condition in it.