Forum Discussion
How to Send an Email when added a News Post in SharePoint Online site
Hi John Edward Paredes there are a number of ways that you could tackle this. You could create a Flow which has a trigger on the Site Pages library to send an email to a user/set of users to inform them that some activity has taken place.
Alternatively, you could use the out-of-the-box Alerts mechanism as displayed in the attached screenshot. This way you can specify whether the alerts are sent out immediately, daily summary or weekly summary.
Matt Weston Hi Matt, The OOTB solution you provided is not helping. When I try to set an alert on News page, then I get alerted whenever changes are on News.aspx and it is published but not when there is any news post added. Am I missing something? How can I set an alert for myself/other users to get alerted on the News post releases? TIA.
- Matt WestonMar 12, 2019Iron Contributor
Hi pdang , if you're looking for alerts when only when a news item is published then you're better off working with Microsoft Flow to achieve this. The OOTB method will send alerts when an item is added to the library regardless of whether it is published or not.
I'll post an example Flow later today just in case you need it.
- Mbryant705Apr 08, 2019Copper ContributorHi Matt,
Can you post some Pointers on how to do this please?
Thanks
Martin- Matt WestonApr 09, 2019Iron Contributor
Hi Mbryant705, sorry I realised I completely forgot to follow up on this post, so also apologies to everyone else involved in the thread.
In a very simple Flow, I can send an email notification when a news item is published. There are a couple of things to be aware of:
- Site Pages won't normally appear in the list of libraries in the trigger, therefore you need to select "Enter a custom value" and then type in Site Pages
- The published state of a document is held within a metadata field called "Promoted state". 1 = in Draft, 2 = Published. If it's a standard site page, not a news item, the Promoted state will be 0.
I can create a condition so that if the Promoted state = 2 (News Item is published) then I can send an email to the required user(s). I can alternatively use the Flow actions to send out a push notification, send a message to Teams etc however you want to get your notification out.
An example Flow is attached to this post. I hope that helps.