Solved

Email multiple external recipients

  • 12 December 2016
  • 8 replies
  • 26 views

Userlevel 6
Badge +12

Hi team,

 

Does anyone know how to send an external email from o365 to multiple external recipients?  I'm not sure what data type to use.  I've tried a semi colon delimited text variable, dictionary and collection variables.  All throw an exception with the error:

 

RequestorId: f461f2f8-3567-47ef-0000-000000000000. Details: System.Activities.Statements.WorkflowTerminatedException: SharePoint operation 'GetUsersByGroupNameAsync' did not return successfully. Status Code: [InternalServerError]{"odata.error":{"code":"-2146232832, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"Group cannot be found."}}}

 

Cheers,

Chris

icon

Best answer by TomaszPoszytek 14 December 2016, 09:48

View original

8 replies

Userlevel 6
Badge +16

The help information (Send an Email ) does not mention that you can set multiple values, so it's sure that it is not currently available.

In that case you could make a loop and send an email inside your loop

Userlevel 6
Badge +12

Yes, I suspect so too Fernando.  Actually the documentation doesn't say either way so I guess we have to assume it only accepts a single recipient.  Anyone else know for sure?

Cheers,

Chris

Userlevel 7
Badge +17

Chris Ben‌ of course you can do it. However to achieve that be aware of two things: first, that you declare the list of recipients as a text variable, emails delimited with semicolon (onuser@mail1.com;user2@mail2.com;user3@mail3.com), that you then put in the action's "To:" field. Second one, which I faced and almost made me crazy - "External email" does not trim the values. So be sure there are no spaces in the string. Mails have to be delimited but without a single space .

Regards, Tomasz

Userlevel 6
Badge +12

Tomasz, you are a legend.  My variable was delimited with a semicolon and a space.  After a quick RegEx to remove the spaces, I'm up and running.  Thanks!

Userlevel 7
Badge +17

I'm glad that I helped you. I even raised a ticket at Nintex after many hours of trying to solve it on my own, then I received their workflow where they proved it is working fine and then after comparing the strings I noticed the spaces. After removal it works ok.

I asked Nintex to make a correction to the O365 backend code, so that it is not vulnerable and trims the strings, but it was just a month ago.

Funny thing is that when using "internal email" option spaces do no harm

Userlevel 7
Badge +17

I'm so glad you found that and also posted here how to solve this. Great job ‌!

I'm having this very same issue at the moment and trying to apply the solution suggested by Tomasz. Can someone point me to details as to how can I "declare the list of recipients as a text variable"?

And three years later it is still not fixed by Nintex. Thanks for your help.

Reply