Email Integration for Queue System Notifications
This guide provides an overview of integrating email notifications into the queue system using external services, including SendGrid. While SendGrid is our default email service provider, the queue system is versatile enough to integrate with other email services if required.
Below, you will find detailed descriptions of template payloads and examples that are applicable for various scenarios within the queue management system.
This approach is an alternative to using webhooks for sending notifications and is particularly useful if utilizing an external SendGrid account.
Template Input Data Overview
The content of dynamic email templates is determined based on the type
of notification, which reflects different events within the queue system:
Booking Confirmations and Changes:
bookingConfirmation
: Customer created a booking.bookingRescheduledToAdmin
: Update sent to a manager when a customer reschedules a booking.bookingRescheduledToCustomer
: Update sent to a customer when they reschedule a booking.remindedAboutBooking
: Reminder sent to customers about their booking.bookingActivated
: Notification that a booking is now an active queue ticket.
Cancellations:
positionCancelledByAdminToCustomer
: Email to customer when staff cancels a future booking.positionCancelledByCustomerToAdmin
: Notification to queue manager when a customer cancels their position.positionCancelledByCustomerToCustomer
: Email to customer confirming their cancellation.positionCancelledByAdminToAdmin
: Notification to admin with an attached ics file to update the calendar.
Operational Notifications:
notifiedToApproach
: Alerting the customer that their turn is coming up soon.positionCalled
: Notification when a position is called by staff.positionRetry
: Notification when staff press 'Retry' due to a no-show.positionRejected
: Email when staff press 'Reject' to remove a ticket.feedbackRequested
: Reminder to provide feedback if it hasn’t been provided yet.
Threshold Notifications:
StaffNotificationPendingTicketsCountThreshold
: Alert when the number of pending tickets reaches a specified threshold.StaffNotificationPeopleAverageWaitingTimeThreshold
: Alert when the average waiting time threshold is reached.
Additional Notification Types
Bookings:
notifiedToLeaveSoon
: Alert that the customer should prepare to leave soon.notifiedToLeave
: Notification that it's time for the customer to leave the store.
Order Pickup:
notifiedAboutBooking
: Notification for a curbside pickup booking.notifiedToReschedule
: Notification when a curbside pickup is rescheduled.
Key Payload Fields
position: Schema of the current ticket or booking state.
actionLink: A URL that varies depending on the type of email, providing actions the recipient can take directly from the email.
Various examples, by type:
bookingConfirmation:
{ "position": { "id": "_id_", "location": { "locationName": "Ombori Street", "organizationTitle": "Ombori Title" }, "type": "booking", "priority": 100, "locale": "en", "notification": { "type": "phoneNumber", "settings": { "from": "", "to": "+phoneNumber", "recipient": "test@email.com" }, }, "station": { "label": "A" }, "booking": { "start": "yyyy-MM-dd HH:mm", // with respect to timezone "end": "yyyy-MM-dd HH:mm", // with respect to timezone "virtualAppointment": { eventId: "AAMkADExYWZmYjI4LTMxMjIt......=" isEnabled: true managerEmail: "virtual-booking@some-domen.com" managerId: "9cd376b6-......." url: "https://teams.microsoft.com/l/meetup-join/19....." } }, "status": "draft", "label": "", // label will generated when time comes "queue": "_queue_id_", "createdAt": "2020-05-26T08:47:37.1700000Z", "bookingReminderAt": null, "QRCodeCheckInPositionId": "{"type":"check-in-position","positionId":"ce4a66df-51ff-47af-bf5e-4e26f82d266b"}" }, "type": "bookingConfirmation", "actionLink": "https://queue.qa.ombori.com/ombori-demo/queues/36a4bdd7-7145-48f9-be92-0fd659f96f92/positions/1c645e74-edd8-48ed-b5c7-3c48fa715c8a" }
<html><head><title></title></head> <body> <div data-role="module-unsubscribe" class="module" role="module" data-type="unsubscribe" style="color:#444444; font-size:12px; line-height:20px; padding:16px 16px 16px 16px; text-align:Center;" data-muid="4e838cf3-9892-4a6d-94d6-170e474d21e5"> <p> {{#equals position.locale "ar"}} حجزك لـ U+202a{{position.date}}U+202c مؤكد الآن. تذكرة: U+202a{{actionLink}}U+202c {{else}} Your booking for {{position.booking.start}} is now confirmed. Ticket: {{actionLink}} {{/equals}} </p> </div> </body> </html>
bookingRescheduledToAdmin
{ "position": { "id": "_id_", "location": { "locationName": "Ombori Street", "organizationTitle": "Ombori Title" }, "type": "booking", "priority": 100, "locale": "en", "notification": { "type": "email", "settings": { "from": "", "recipient": "test-manager@email.com" }, }, "station": { "label": "A" }, "booking": { "start": "yyyy-MM-dd HH:mm", // with respect to timezone "end": "yyyy-MM-dd HH:mm", // with respect to timezone "virtualAppointment": { eventId: "AAMkADExYWZmYjI4LTMxMjIt......=" isEnabled: true managerEmail: "virtual-booking@some-domen.com" managerId: "9cd376b6-......." url: "https://teams.microsoft.com/l/meetup-join/19....." } }, "status": "draft", "label": "", // label will generated when time comes "queue": "_queue_id_", "createdAt": "2020-05-26T08:47:37.1700000Z", "bookingReminderAt": null, "QRCodeCheckInPositionId": "{"type":"check-in-position","positionId":"ce4a66df-51ff-47af-bf5e-4e26f82d266b"}" }, "type": "bookingRescheduledToAdmin", "actionLink": "https://queue.qa.ombori.com/ombori-demo/queues/36a4bdd7-7145-48f9-be92-0fd659f96f92/positions/1c645e74-edd8-48ed-b5c7-3c48fa715c8a" }
bookingRescheduledToCustomer
remindedAboutBooking
bookingActivated:
positionCancelledByAdminToAdmin
positionCancelledByAdminToCustomer:
positionCancelledByCustomerToCustomer
positionCancelledByCustomerToAdmin
notifiedToApproach
positionCalled
positionRetry
feedbackRequested
positionReject
StaffNotificationPendingTicketsCountThreshold
StaffNotificationPeopleAverageWaitingTimeThreshold