Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 20, 2019 12:00 am GMT

Sending a Notification to Alexa when Netlify Builds Your Site

This will be a quick post and credit for the idea goes to Stacey Higgenbotham and her post from last year, How to trigger custom Alexa notifications from a smart home event.

In her post, she describes how to use the Notify Me skill on Alexa to allow for custom notifications. When you add the Notify Me skill to Alexa, you get an email with a unique access code. You can then head over to the web site, https://www.thomptronics.com/about/notify-me, and check out the docs. At the simplest level, you can just hit a URL like so:

https://api.notifymyecho.com/v1/NotifyMe?notification=Hello%20World!&accessCode=ACCESS\_CODE

Thats the entire API, seriously. You can pass an additional title attribute and the API is flexible in terms of accepting GET, POST, or PUT. Heres an example of how it looks on my Echo Spot.

Example of Alexa notification being shown

In this case, the text of the notification is not visible, just the title, but if I ask her for my notifications, Ill hear the full text.

Given that youve enabled the skill and gotten your access code, then how would you set it up to get notifications on builds?

Log in to Netlify, go to your site, Settings, Build & deploy, and then finally Deploy notifications:

Netlify's list of notifications

Click the Add notification button and select Outgoing webhook:

Menu for notification optins

First figure out what you want to be notified on, most likely Deploy succeeded, and in the URL enter the URL in the form I shared above. Perhaps something like this:

https://api.notifymyecho.com/v1/NotifyMe?notification=Build%20Done&title=Build%20Done!&accessCode=ACCESS_CODE

Remember that only the title will be visible, but you could include more information in the notification part to provide context, perhaps the name of the site that was deployed.

Example webhook value

And thats it! If you want you can go to the Deploys menu and hit Trigger deploy to force a new build. I wish there was a bit more control over the UI of the notification, but for a free service Ill take it.

Header photo by Prateek Katyal on Unsplash


Original Link: https://dev.to/raymondcamden/sending-a-notification-to-alexa-when-netlify-builds-your-site-1n2e

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To