Automate Weekly Newsletter

Bala Madhusoodhanan - Apr 25 '23 - - Dev Community

Last week the blog was to automate the Microsoft RSS feed. This week the concept is same but the power automate flow is simplified and the RSS feed that is automated is with security podcast SmashingSecurity

Implementation:

  • Collection of data: The RSS connector would enable you to get a JSON data which we would manipulate in the following steps

Image description

  • Condition: Instead of leveraging filter array, condition is leveraged to pull the needed content. We will Parse the Publish Date field from the RSS feed leveraging function as below. Grabbing the last published feed would be using the [0] index and the object is ['publishDate']
body('List_all_RSS_feed_items')[0]?['publishDate']
Enter fullscreen mode Exit fullscreen mode

Compare the latest publishDate and validated if its published in the last 7 days.

addDays(utcNow(),-7)

Image description

  1. Yes - If the condition above is satisfied , post the message in a Microsoft TEAMS channel

Image description

  1. If the condition is not met then no action
  • Email Composition Mapping the Subject of email as the RSS feed title
body('List_all_RSS_feed_items')[0]?['title']
Enter fullscreen mode Exit fullscreen mode
  • Extracting Test for body of email The split() function returns an array of substrings. We have used 2 delimiters with the split function ('Sponsored by:' or 'Episode links:'). [0]: This specifies that we want to access the first item in the resulting array, which is the substring before "Sponsored by:".[1]: This specifies that we want to access the second item in the resulting array, which is the substring after "Episode links:".
split(split(body('List_all_RSS_feed_items')[0]?['summary'],'Sponsored by:')[0],'Episode links:')[1]
Enter fullscreen mode Exit fullscreen mode

The simplified PowerAutomate flow would be

Image description

The result !! automated the PodCast summary as a weekly newsletter to the team to learn and enrich the knowledge ....

Image description

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .