Automation events
An automation event is a custom event you create in Go-Mailer and trigger from your own applications to start your automations.
Trigger an event
You need two pieces of information: the code of the event to trigger, and a context object with the relevant details about the event.
POST
https://api.go-mailer.com/v1/automationsRequest body
| Parameter | Type | Required | Description |
|---|---|---|---|
event_code | string | Required | The unique code that identifies the event. No two events should share a code. |
contact_email | string | Required | The email address of the user the event was triggered for. It identifies the user. |
context | object | Optional |
|
Sample request
POST /v1/automations
const response = await fetch("https://api.go-mailer.com/v1/automations", {
method: "POST",
headers: {
Authorization: "Bearer <API_KEY>"
},
body: JSON.stringify({
event_code: "makes_purchase",
contact_email: "johndoe@example.com",
context: {
firstname: "John",
lastname: "Doe",
item: "iPhone",
price: 1999.99
}
})
});