Forum Discussion

Matt Weston's avatar
Matt Weston
Iron Contributor
Mar 12, 2019

Re: How to Send an Email when added a News Post in SharePoint Online site

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.

16 Replies

  • Mbryant705's avatar
    Mbryant705
    Copper Contributor
    Hi Matt,

    Can you post some Pointers on how to do this please?

    Thanks

    Martin
    • Matt Weston's avatar
      Matt Weston
      Iron 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.

       

       

      • Newbie270's avatar
        Newbie270
        Copper Contributor

        Matt Weston 

         

        This works 100% however..... If for some reason i go back to an older news post and edit or republish then another email comes out. Is there a way to send out the email on promote state = 2 (original news post) But not to send out any future emails even if someone makes a change to the post?