If you ever need to extract the HTML content from a modern SharePoint Online page, there is a REST API call you can use. I decided to use this HTML content and automatically insert this into an email. Therefore, when a user writes a news post on a SharePoint site, an email can also be sent using Power Automate to gain maximum impact and exposure.
Firstly, you need to create your SharePoint page in the Site Pages library on your site. Once you have created your page, use the following REST API call.
_api/web/lists/getbytitle('Site%20Pages')/items?$select=Title,CanvasContent1,FileLeafRef&$filter=FileLeafRef eq 'Page-Title.aspx'
From this call, you will receive the filename (FileLeafRef), page title (Title) and the file content (CanvasContent1). The CanvasContent1 is the HTML of the page and what you want to insert directly into the email.
If you have an email template that you use for announcements or important communications, open an existing email from your inbox. Right-click on the body of the email and select View Source. A text document will open with the source code of the email message. You can use this code and insert it into the Send an email action in Power Automate.
Before you paste the code into the Send an email action, make sure you select the Code View button to change the body to HTML.
Find the area where you would normally put the content of your email. Replace the existing HTML code with the CanvasContent1 HTML data from your REST API call.
And that’s it! There are many different ways you can trigger this flow. You can set up a recurring flow that sweeps the sites each hour or at night which will send emails of from the new pages it finds. Or, you can insert an approval flow on your Site Pages library. Once the page has been approved, the announcement email will be sent. Once you have the HTML of the page, the options are endless!