388
Views
12
Comments
Solved
Multiple Email recipients in To, CC & BCC fields
Application Type
Traditional Web
Service Studio Version
11.14.16 (Build 60354)

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
2021-08-31 11-16-27
Craig Merrick
Solution

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 :)

2022-10-18 07-32-49
Randall Jodache Chetty

Thanks for sharing 

2024-01-31 05-29-41
Akshay Deshpande

Hello crig,

Your logic is work because the comma separate only check first instant not all
In your case

E1 +"," E2+","E3

like this

so for next instant you need to write same logic with new substring

E2+","E3

maybe you got this . if yes, this will helps you

Thanks and Regards,

Akshay Deshpande

2023-03-16 16-29-51
Paulo Rosário

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

2021-08-31 11-16-27
Craig Merrick

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

2022-09-20 06-28-12
Nitish Kumar

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

2021-08-31 11-16-27
Craig Merrick

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.


2022-09-20 06-28-12
Nitish Kumar

Hi Craig Merrick,

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.

Thanks & Regards

Nitish Kumar

2021-08-31 11-16-27
Craig Merrick

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.

2021-08-31 11-16-27
Craig Merrick
Solution

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 :)

2022-10-18 07-32-49
Randall Jodache Chetty

Thanks for sharing 

2022-07-25 09-47-59
Simran Vaswani

Hi Craig,

Do you by any chance have an oml of how you achieved this? Was stuck in a similar situation.

2021-08-31 11-16-27
Craig Merrick

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... 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.