On This Day WordPress Email

Short Version | To set up an on this day email from a WordPress blog thing; download on_this_day plugin, upload to your site, and active. Then set up a Microsoft Flow RSS to email flow to watch the RSS feed and send emails when new things show up.

More words version with color

My top Facebook feature is when it reminds me of a post I made in the past. Life has been good, and Facebook is where some of the great parts end up being shared. Being reminded of things from the past makes me happy = great feature. Last great reminder was from 8 years ago when Adam, Phil, Micheal, Martin and I had a day of Man Olympics inspired by one of their friends coming to visit from CA. Was a great day I’d not thought about in many years. It sparked me sending an email to everyone saying HEY!! and made me smile a bit.

PastPost.jpg

Then an Idea hit me — I better add an on this day feature to WordPress and enabled it for my blogs

  • I’ve been blogging for well over a decade at a few sites.
  • Occasionally, I’ve searched for answers to tech questions only to find a post on my blog I wrote years ago and had completely forgotten about. Thanks past me for once being smart
  • There has to be all kinds of great memories out there worth reminding myself of.

The Plugin

I searched for a bit and did not find a plugin in the plugin library. At first, the vision was to attempt to write the plugin myself. While talking to Wes about my vision he did a borader search and found a simple RSS feed plugin already written on github Thank you very much Terence for taking the time to publish your project.  86 lines of PHP is what Terence published in 2.18kb PHP file; simple and elegant. I downloaded the file and FTP uploaded it to the WP plugin folder for my sites and pressed the activation button under plugin manager.  I tried to upload via WordPress but it expects more than a single PHP file. Without all of the extra plugin stuff, you need to manually upload the file. The PHP creates an RSS feed that publishes past posts from today hourly at the URL <siteFQDN>/?on_this_day – example link for my site

http://www.happymillfam.com/?on_this_day

plugin.JPG

The Flow

RSS feeds were cool a few years ago, but they are not cool living in the future we live in today. Today all of the cool kids are into If This Then That (IFTT) stuff. IFTT has been a hobby for the year. I’ve written a bunch of Powershell to create my own IFTT engine at home for a few things. A few of the scripts I’ve written are tied into Microsoft Flow’s IFTT engine. Knowing Microsoft Flow fairly well, Flow seems like the perfect tool to watch the RSS feed and send an email when something new shows up.

Setting up the On this Day vision is pretty simple so far. Didn’t have to write any code at all; find code already written, then click a bit in a template. Flow has an RSS to email template, all you have to do is click and fill in the boxes. To setup the Flow it only took a few clicks, add the RSS link, and set the email address to send the notifications too. Everything set up, next step waiting. It was only a matter of time before the RSS feed would come back with data.

Flows.JPG

Less then 24 hours later is all it took for a reminder to show up on the Feed and an email to make it into my mailbox. The first hit was a post from two years ago about our first hot tub at the Olalla house. Not far in the past, but such a different life than the life we have now in Ireland. Miss parts of it, do not miss others. Missing or not life is amazing right now.

OnThisDay.JPG

The RSS feed looks like it should in IE. It fails in Edge which tries to download a TXT file; sad face. The first email, on the other hand, is not pretty at all. The email is plain text formatted and missing the key information, the link to the post. Check it below, ugly, right?

EmailPlainText.JPG

What the email says is the vision is working. The problem if bad formatting is simple, we can make pretty emails. Challenge presented, back into flow to work out how to make things pretty. The first change was to select HTML for the email format vs Plain text. Changing to HTML would make the big link in the email above magically change into a picture vs being a block of HTML. Next, I added some simple HTML formatting like; made titles bold, added some line breaks. Next, I added some dynamic content to add the link to the post. Lastly, after some testing, I modified the subject to be consistent vs dynamic based on the RSS feed.. See below for the options I choose.

FlowMessage with formatting.JPG

 

After about 20 minutes of tweaking and testing, the email is now pretty and right in line with the vision – Time to blog about it then we can call this Project completed.

FinalEmail.JPG

 

 

Leave a Reply