I've been looking all over for a solution and way to do this and have found many different options, some which date back to 2018 and am not sure are the most current process.
Basically I want an automatic email to be sent to only the members of the SharePoint group that have access to that page, and only when a news post is published (not updated).
So I have created a test flow based on all the research I can find. It is:
1. When a file is created or modified (properties only) > Library name 'Site pages' > Condition (Promote is equal to 2) > if yes send email
Whilst this confuses me somewhat and I'm not sure how this works exactly, I've ran a test and functionally it works. An email was sent (just to me in this test case) when I published a news post in that SP group. BUT, it also sent an email when I edited the news post which is not really ideal.
The next thing I need to understand is how to email the whole group of members as well, not just individuals. Would this require me to include a 'Initialize variable' connector? And where in the flow would this go (if this is the right connector?).
Any and all help is much appreciated!
Hi @laura_marsden ,
Firstly, you could replace 'when a file is created or modified' with 'when a file is created' .
Secondly ,you could call SharePoint API to get the group member.
_api/Web/SiteGroups/GetByName('{YourGroupName}')/users?$select=Email
I've made a test for your reference :
1
body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']
2
item()['Email']
Best Regards,
Bof
Thanks heaps.
I am giving it a try with a test but it's missing values:
What am I joining it with? It's not clear in your image. But I have put a colon ( : ).
This works and I can save the flow.
However when running it, it says it can't find the group.
Is there some sort of special way the name is supposed to be written?
E.g. My test has these groups
which I'm using in the flow:
But it fails as says can't find group:
Is this because I am the only one in the group, or because of a naming convention?
The actual SP group has over 100+ people in it so am not wanting to test in the live group.
Ok so I've tried the above and had little success.
I've found some videos online which help expand on the solution above. But this also does not seem to work.
I would love if someone could help explain how to do this and reasons why it may or may not work.
My flow now looks like this:
The schema I was able to pull from running the flow on a manual trigger.
For whatever reason whenever I publish a news post it doesn't send the email to that group of emails.
It says it succeeded but it actually doesn't.
In the successful runs it says the outputs go to this email: Personal-Group@88043133P.onmicrosoft.com
However no email comes through.
Can you confirm if this API will only call from a new group with all the emails for that group added to it?
Cause I can't seem to get it to work with the Members, owners or visitors group. Is this because there is not actually any email entries in those groups?
Like those groups have email addresses like so: TestSPgroup-Group@8880000P.onmicrosoft.com