I'm having trouble working out how to key multiple email recipients.
The email addresses are retrieved and stored as input parameters and some as local variables.
I want to be able to use a combination of these within the 3 available recipient fields (To, CC & BCC)
I've read that emails can be separated by using "," however I only ever seem to get an email for the first address in the expression. In the example below, I will only ever get the email addressed to the address assigned to 'EmailAddress1'
Any help is greatly appreciated.
My expression within the 'To' field is as below -
EmailAddress1 + "," EmailAddress2 + "," EmailAddress3
I thought I'd make another post just to confirm I now have this working.
I assigned the variable addresses to their own variable and referenced the new 'combined variable' within the recipient field and this worked.
@Nitish Kumar You deserve credit for showing a combined variable as this aided the solution. So thank you :)
Thanks for sharing
Hello crig,
Your logic is work because the comma separate only check first instant not allIn your caseE1 +"," E2+","E3
like this
so for next instant you need to write same logic with new substringE2+","E3maybe you got this . if yes, this will helps youThanks and Regards,
Akshay Deshpande
Hello Craig,
The only issue with your string is that you are missing a few + signs.
Try something like :
EmailAddress1 + "," + EmailAddress2 + "," + EmailAddress3
Hope it helps!
Paulo Rosário
Hi Paulo,
I've tried your suggestion however in my 'test inbox' the 'To' field still only shows the first recipient email address from the string within O/S. In this case - EmailAddress1
Hi Craig Merrick,
I have also assigned multiple mail IDs to mail's TO Variable in the below-given formate and it seems working fine.
For your reference sending you some screenshots.
Email1+","+Email2+","+Email3
I hope it will fix your issue.
Thanks & Regards
Nitish Kumar
Hi Nitish,
Is assigning the individual variable email addresses to a combined variable required or can I reference each individual variable email address within the 'To' field as per below?
There is a feature toggle to determine which address variable to use. Either both email1 & email2 (which is populated via a site property) or just email1.
The feature toggle is turned on so the only logical outcome should be both Email 1 & 2 getting the email which is not happening.
In your case seems like this IsFeatureToggleOn is not working as you expect. To fix I suggest copying your above written IF condition from TO to some local variable within the action before mail and then trying to print the value of that variable on any screen or try to debug the action to find out what value this whole if expression is returning to you.
Hope this will fix your issue.
Hi @Nitish Kumar
I have tried debugging and IsFeatureToggleOn is validating to 'IsOn' so I don't think the issue is with the feature toggle.
Hi Craig,
Do you by any chance have an oml of how you achieved this? Was stuck in a similar situation.
Hi, I achieved this as per below...
For ease of reading I assigned the local variable 'ToRecipients' differently for each branch but I 'm sure you could do it all within a single assign action but all paths end up sending the same email, just with different recipients.
I constructed the string within the assign out of the email addresses I wanted to use (as variables in this instance)
Then on the actual email, I used the 'ToRecipients' variable in the 'To' or 'CC' etc...
Got it! Thank you!