Youâll walk through the workflow in sections, and at the end, see a completed workflow. In this example, youâll use the template calendar-event-reminder.
The Calendar Event Reminder Workflow lets you create an event, then send out multiple reminders using email, text, or webhooks. Use webhooks to send reminders to any webhook URL including Teams and Slack.
Create Your First Workflow
Creating a workflow with Nylas requires 1 API call. Youâll walk through the workflow in sections, and at the end, see a completed workflow. In this example, youâll use the template calendar-event-reminder.
Prerequisites
- Create a Nylas account.
Ready to Start Building?
Try it FreeStep One Create An Event
To use the calendar-event-reminder
template, you need to create a calendar event. The template calls the Calendar Event endpoint to create events. You can list multiple participants; only an email address is required.
SMS Alerts
You must include a North American phone number if you want to use SMS reminders.
"template": "calendar-event-reminder",
"data": {
"create_calendar_event": {
"calendar_id": "string",
"when": {
"start_time": 1607812301,
"end_time": 1607814101
},
"title": "Let'\''s meet",
"description": "Don'\''t forget to wear masks folks.",
"location": "Coffee Shop at Mandalore",
"busy": true,
"participants": [
{
"name": "John Doe",
"email": "[email protected]",
"status": "yes",
"phone_number": 15149998877,
"comment": "string"
}
]
},
...
Step Two Create a Reminder
You can create three types of reminders:
- SMS
- Webhook
The following example shows an email reminder. You can send email reminders with file attachments and message tracking. The time_before_event
parameter is used to set the time a reminder is sent in minutes. You can send multiple reminders and multiple types of reminders.
...
"reminders": [
{
"type": "email",
"time_before_event": "600",
"subject": "Don'\''t forget",
"body": "Reminding you about our meeting.",
"file_ids": [
"string"
],
"tracking": {
"links": true,
"opens": true,
"thread_replies": true,
"payload": "string"
}
}
]
}
}'
Step Three Complete Workflow Request
Instead of needing to make multiple API requests, you only need to make one request to create events and send reminders.
curl --location --request POST 'https://api.nylas.com/workflows' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"template": "calendar-event-reminder",
"data": {
"create_calendar_event": {
"calendar_id": "string",
"when": {
"start_time": 1607812301,
"end_time": 1607814101
},
"title": "Let'\''s meet",
"description": "Don'\''t forget to wear masks folks.",
"location": "Coffee Shop at mandalore",
"busy": true,
"participants": [
{
"name": "John Doe",
"email": "[email protected]",
"status": "yes",
"phone_number": 15149998877,
"comment": "string"
}
]
},
"reminders": [
{
"type": "email",
"time_before_event": "600",
"subject": "Don'\''t forget",
"body": "Reminding you about our meeting.",
"file_ids": [
"string"
],
"tracking": {
"links": true,
"opens": true,
"thread_replies": true,
"payload": "string"
}
}
]
}
}'
Congrats!
Thatâs it! Youâve created your first event with an email reminder and only needed to make one API request!
Updated 24 days ago