An Interest In:
Web News this Week
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
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.
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:
Click the Add notification button and select Outgoing webhook:
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.
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
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To