Objective: To automatically send event details (title, link, and date) from a webhook payload to a Discord channel.
Prerequisites:
- A Zapier account (free or paid).
- A Discord account with a server and a channel where you want to receive notifications.
- A source that sends the event payload via a webhook (e.g., an API, a form, or another service).
Steps:
1. Create a New Zap:
- Log in to your Zapier account.
- Click the "Create Zap" button on the Zapier dashboard.
2. Configure the Webhook Trigger (Catch Hook):
-
Choose App & Event:
- Search for and select "Webhook by Zapier."
- Choose "Catch Hook" as the trigger event.
- Click "Continue."
-
Copy the Webhook URL:
- Zapier will generate a unique Webhook URL. Copy this URL. You'll need it to configure your payload source.
- Click Continue.
-
Test Trigger:
- Before testing, you must send a sample of the payload to the webhook URL.
- Using a tool like curl, Postman, or the service that generates the payload, send a POST request to the copied Webhook URL with the following JSON payload in the request body:
JSON
[ { "type": "event", "data": [ { "id": 123, "title": "My Event Title", "key_persons": [], "description_short": "My Event description", "picture": { "url": "...", "path": "...", "thumbnail_width": 400, "thumbnail_height": 400, "thumbnail_format": "auto", "thumbnail_url": "..." }, "chapter": { "chapter_location": "Catamarca (AR)", "city": "Catamarca", "country": "AR", "country_name": "Argentina", "description": "<p>Cras ac mattis ligula, sit amet pulvinar dui.</p>", "id": 8, "hide_country_info": false, "logo": {}, "chapter_team": [ { "id": 22, "user": {}, "role": {}, "title": "Chapter leader" } ], "state": "", "timezone": "Pacific/Niue", "title": "John Perez", "relative_url": "/chapter-slug/", "url": "https://bevy.bevylabs.com/
chapter-slug/ ", }, "start_date": "2023-05-01T12:29:15-09:00", "end_date": "2024-03-30T12:28:00-09:00", "url": "https://bevy.bevylabs.com/events/details/chapter-slug- ", "status": "Published", "created_ts": "2023-05-11T06:28:34.479747-presents-my-event/ 09:00", "updated_ts": "2024-01-24T07:23:57.064179- 09:00", "published_by_full_name": "John Perez", "venue_name": "Boca Juniors", "venue_address": "780 Avenida Almirante Brown", "venue_city": "C1155AER", "venue_zip_code": "C1155", "get_event_address": "Boca Juniors - 780 Avenida Almirante Brown C1155AER, C1155", "event_type_title": "Virtual Event type", "allows_cohosting": false } ] } ] - Go back to Zapier and click "Test trigger." If the payload was sent correctly, Zapier will display the received data.
- Click "Continue."
3. Configure the Discord Action (Send Channel Message):
-
Choose App & Event:
- Click the "+" button below the Webhook trigger.
- Search for and select "Discord."
- Choose "Send Channel Message" as the action event.
- Click "Continue."
-
Connect Discord Account:
- Click "Connect an Account" and follow the prompts to authorize Zapier to access your Discord server.
- Select the desired Discord server and channel.
- Click "Continue."
-
Configure the Message:
- In the "Message" field, enter the following template:
New Event: Title: {{1.data.0.title}} Link: {{1.data.0.url}} Date: {{1.data.0.start_date | date: 'YYYY-MM-DD'}}
- Explanation of the template:
-
{{1.data.0.title}}
: Extracts the event title from the payload. -
{{1.data.0.url}}
: Extracts the event URL. -
{{1.data.0.start_date | date: 'YYYY-MM-DD'}}
: Extracts and formats the event start date.
-
- Leave the other fields as default or adjust them as needed.
- Click "Continue."
- In the "Message" field, enter the following template:
-
Test the Action:
- Click "Test & Review" or "Test & Continue" to send a test message to your Discord channel.
- Verify that the message appears correctly in your Discord channel with the event details.
- If the test is successful, click "Continue."
4. Turn on the Zap:
- Review your Zap settings.
- Click the toggle switch at the top of the Zap to turn it on.
5. Configure the webhook in Bevy:
- Configure Bevy to send a POST request to the Webhook URL you copied in step 2.
- Check "Send event updates" in the option
- Learn more in Configure-webhooks article
Important Notes:
- Error Handling: Consider adding error handling to your Zap, such as using filters to check for required fields before sending messages.
- Date formatting: Zapier has many date formatting options. Explore those options to display the date in your preferred format.
- Payload Structure: If the payload structure changes, you will need to update the message template in the Discord action.
- Testing: Always test your Zap thoroughly before relying on it for production use.
- Rate Limits: Be mindful of Discord's rate limits to avoid being blocked.
Comments