Platform
Docs
Solutions
ContactLog In

Start Routing Notifications Today!

Courier is a notification service that centralizes all of your templates and messaging channels in one place which increases visibility and reduces engineering time.

Sign-up

Courier Live Header
COURIER

Trick-or-Treating From a Distance Using Slack

Aydrian Howard

November 18, 2020

For our Pre-Halloween October 28th Courier Live, Nate Munger returned to help me come up with a socially distanced way to handle Trick-or-Treaters using Courier. Taking inspiration from the Smart Security Camera RaspberryPi project, we thought it would be cool to disguise one of those as a Halloween decoration and have it send images of approaching Trick-or-Treaters to a Slack channel with buttons that would allow members to present them with a Trick or a Treat. We walked through setting up the Slack notification in Courier and handling the buttons using a Glitch app. We'll leave delivering the tricks and treats to you.

Check out the video below to watch us:

  • Create a new Slack App and install it to our test workspace
  • Build a new Slack notification with action buttons using Courier
  • Use a Glitch Node.js/ExpressJS application to handle the Slack button actions
  • Send the notification using the Courier Send tab

Code for the Node.js/ExpressJS server handling the Slack actions can be found in the Glitch application.

Be sure to Like the video and Subscribe to our YouTube channel.

Adding Custom Slack Buttons

For this project, we wanted to have 2 Slack buttons side by side. To do this, we used the Jsonnet block to build a Block Kit Actions Block. The following code when used in a Jsonnet block will result in the following:

trick or treat

1
{
2
"type": "actions",
3
"elements": [
4
{
5
"type": "button",
6
"action_id": "btnTrick",
7
"text": {
8
"type": "plain_text",
9
"text": "Trick :ghost:",
10
"emoji": true
11
},
12
"value": "trick"
13
},
14
{
15
"type": "button",
16
"action_id": "btnTreat",
17
"text": {
18
"type": "plain_text",
19
"text": "Treat :candy:",
20
"emoji": true
21
},
22
"value": "treat"
23
}
24
]
25
}

The actions for the resulting buttons can be handled using a server like we created above. Action Blocks can be more than just buttons. Check out the other available Interactive Block elements.

Is there something you’d like to see us do using Courier? Let us know and it might be the subject of our next Courier Live. We stream a new Courier Live every Wednesday at noon Pacific. Follow us on Twitch to be notified when we go live.

-Aydrian

Start Routing Notifications Today!

Courier is a notification service that centralizes all of your templates and messaging channels in one place which increases visibility and reduces engineering time.

Sign-up

More from Courier

data-thumbnail
COURIER

Tools and Techniques to Establish Your Data Team Early

How tools like Segment, Metabase, Snowflake, Census, and others, can help establish a data team from the very early stages in a startup.

Raymond See

Raymond See

February 16, 2023

QOTD Thumbnail
ENGINEERINGCOURIER

Develop a Motivational QOTD with Courier and GPT2

Courier and OpenGPT2 in action: build a service that sends friends and family an AI generated motivational quote of the day.

Prakhar Srivastav

Prakhar Srivastav

February 09, 2023

Build your first notification in minutes

Send up to 10,000 notifications every month, for free.

Get started for free

Email & push notification

Build your first notification in minutes

Send up to 10,000 notifications every month, for free.

Get started for free

Email & push notification

Platform

Users

Content

Channels

Sending

Workflows

Preferences

Inbox

Workspaces

Observability

API Status

Changelog

© 2024 Courier. All rights reserved.