If you are working on SharePoint, you know it is easy to send an email to SharePoint groups through SPD/Nintex workflows, because these are the apps related to SharePoint which know the SharePoint context. On the other hand, MS Flow is a separate Office 365 app and independent of SharePoint but this also helps in automating the workflows. However, here comes the issue. MS Flow can recognize the O365 users but there is no straightforward way to get the SharePoint group users from the dynamic data.
There are different ways to achieve this solution. In one of the articles I read online, the user did a REST call to get all the group users from the group and had to use foreach loop to get all the users' email ids in a variable. Then, he used that variable to send an email. But I found the following way very simple and time saving.
In short, we are going to send an email via SharePoint Rest API by hitting "/_api/SP.Utilities.Utility.SendEmail" pointing to send the email to SharePoint group.
Steps
- In your flow, add this step – Send an HTTP request to SharePoint.

- Fill in the following details.
- In the Site Address, select your SharePoint site URL.
- Select the method as POST.
- In URI, add this endpoint : /_api/SP.Utilities.Utility.SendEmail
- In headers, accept application/json;odata=verbose
content-type: application/json;odata=verbose - In Body, write the following code.
- {
- 'properties': {
- '__metadata': {
- 'type': 'SP.Utilities.EmailProperties'
- },
- 'To': {
- 'results': ['test group ']
- },
- 'Body': '<p>This is a test email</p>',
- 'Subject': 'Test email from MS Flow'
- }
- Please check the screenshot to verify.

- Now, run your workflow. I created a test group in which two users were present. Below is the email that I have received from [email protected]. This is another advantage using SP utilities to send email. If you use default send email action, the MS Flow runs on the context of the user who created the flow and sends email from his email id. So, going with SP utilities is a great advantage if you wanted to send system-generated type of emails.


Eraj BaizoevPosted Jan 13, 2021, 6:44 AM
Hello Harsha, I like your post, really nice points. I tried implement, however it fails on the step below: Action 'Send_an_HTTP_request_to_SharePoint' failed The property '__metadata' does not exist on type 'SP.Utilities.EmailProperties'. Make sure to only use property names that are defined by the type. What is wrong with my request body? { 'properties': { '__metadata': { 'type': 'SP.Utilities.EmailProperties' }, 'To': { 'results': ['App Testers'] }, 'Body': ' <b>Hello,</b><br><br> <p>This is a test email</p> ', 'Subject': 'Test email from MS Flow' } }
Larisa SapPosted Aug 19, 2020, 11:44 AM
Hi Harsha, I tested your solution, it only works if the user who created the flow is part of a SharePoint group to receive notification. Is it true? Is there a way to around, as I am an admin, I don't need to receive all the notifications. Thank you!
Maruthi KiranPosted Jul 30, 2020, 12:26 AM
Hi Vardhini, I don't see key value pairs for Headers in Send Http request to SharePoint. It is blank. Any suggestions
L BradyPosted Jul 13, 2020, 1:52 PM
This is a life-saver! Thank you for sharing! Can I share this URL on other sites?
Pakkiya NathanPosted Apr 1, 2020, 5:52 AM
In this the mail has been received to user with the name of ModernSite(which your site Name) ,,,Is there any posibilities to change that name??
Misty MillerPosted Jan 29, 2020, 3:57 AM
My output has returned with a status code of 200 but with the SendEmail method returning a null value in the parsed JSON. I have Google the heck out of this. The input is retrieving the correct value. Any suggestions?
Nagarajan ElumalaiPosted Aug 13, 2019, 12:06 AM
Thanks let me check it
Nagarajan ElumalaiPosted Aug 6, 2019, 8:00 AM
Do you have any tutorial for flow with powerapps
Sagar PardeshiPosted Aug 5, 2019, 11:05 AM
Good one Keep it up..