How to activate webhook triggered by e-mail generation
Glide is able to send information to a custom webhook whenever an e-mail message is sent from the Glide system.
To activate this follow these steps:
- Click on the Config menu (Superuser access required).
- Click on Configure webhook triggers.
- Scroll down until you find the on Send e-mail trigger.
- Click the green New button below.
- Enter your webhook URL into the pop up and click save.
Information will now be sent to the webhook whenever an e-mail is sent. It is sent as a form-encoded POST with these fields:
- eventType and eventInfo: always Email and Email Generated.
- emailFromName: the from name.
- emailFromAdd: the from address.
- emailDestination: the to address.
- emailSubject: the e-mail subject.
- emailMessage: the content of the e-mail in HTML format.
- emailMessagePlainText: currently contains the same HTML content as emailMessage.
- emailDataGlideClientID: the unique ID of the client that the e-mail relates to.
- emailDataGlideJobID: the unique ID of the job that the e-mail relates to (if applicable).
- emailDataGlideLink: the unique ID of the contact the e-mail was sent to (if applicable).
- emailDataGlideTemplate: the unique ID of the e-mail template that generated the message (if applicable).
- emailDataGlideID: the unique ID Glide has assigned to the message.
- whSendTime: the date and time the webhook was sent, as a Unix timestamp.
Key points:-
- The trigger occurs when Glide's sending queue sends the message, not when the message is first created. If your messages are added to a queue for manual sending, or held until working hours, the webhook does not fire until they are sent.
- The webhook fires just before the e-mail is handed to the mail server, so it will trigger even if the message sending then fails, for example where the message is bounced by the receiving mail server. It does not fire if the to or from address is invalid.
- The message will send for all e-mails sent. You will need to filter as required in your script / Zap. For example this will likely be to identify a specific template.
- You can use this webhook service to send all of your e-mails from a different e-mail server, for example using the GMail Zapier app. You would need to deactivate sending in Glide. The webhook still fires when sending is deactivated.