Skip to content
betterstack-alchemyUnofficial

Incidents.OutgoingEmailIntegration

Kind ResourceType id BetterStack.Incidents.OutgoingEmailIntegrationSource src/Incidents/OutgoingEmailIntegration.tsOffline only Tested against the offline mock only: the lifecycle runs against the offline mock only (test/Incidents/OutgoingEmailIntegration.test.ts).

Sends e-mails about your incidents to addresses outside Better Stack, such as a customer’s distribution list. recipients are objects with an email and up to 10 extra text keys (rendered as $RECIPIENT.<key> in templates). The onIncident* toggles pick the stages that send an e-mail, and templates replace the default subject, title and body per stage ($NAME, $CAUSE, $INCIDENT_URL, $METADATA.Key, …).

Every prop updates in place except teamId, which replaces the integration. A recipients or templates list replaces the whole list; removing templates from the config keeps the integration’s templates (send [] to drop them all). name defaults to a generated unique name. paused is read-only here.

E-mailing a customer about their incidents

Section titled “E-mailing a customer about their incidents”

Started and resolved, with a custom subject

yield* BetterStack.Incidents.OutgoingEmailIntegration("customer-updates", {
name: "ACME status e-mails",
recipients: [{ email: "oncall@acme.example" }],
onIncidentStarted: true,
onIncidentResolved: true,
onIncidentAcknowledged: false,
onIncidentReopened: false,
onIncidentComment: false,
templates: [{ incidentStage: "started", subject: "[ACME] $NAME is down", title: null, body: null }],
});

recipients CreateIncidentsOutgoingEmailIntegrationRequestRecipientsItem[] required

The people the integration e-mails. Each recipient is an object with an email key and up to 10 extra text keys, such as first_name, which templates render as $RECIPIENT.<key>. A plain e-mail address is also accepted in place of the object.

name string

The name shown in the dashboard. Defaults to a unique name generated from the stack, stage and logical id.

notifyAlongsidePrimaryResponder boolean

Whether to e-mail the recipients alongside the primary responder on incidents with no escalation policy.

onIncidentAcknowledged boolean

Whether to e-mail the recipients when an incident is acknowledged.

onIncidentComment boolean

Whether to e-mail the recipients when a new comment is posted on an incident.

onIncidentReopened boolean

Whether to e-mail the recipients when an incident is reopened.

onIncidentResolved boolean

Whether to e-mail the recipients when an incident is resolved.

onIncidentStarted boolean

Whether to e-mail the recipients when an incident starts.

teamId string

Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.

templates CreateIncidentsOutgoingEmailIntegrationRequestTemplatesItem[]

Custom subject, title and body for stages of an incident, one entry per stage. A blank subject, title or body uses the default template.

id string always set

The incidents_outgoing_email_integration's id.

name string | null

The integration's name, shown in the dashboard.

notifyAlongsidePrimaryResponder boolean

Whether to e-mail the recipients alongside the primary responder on incidents with no escalation policy.

onIncidentAcknowledged boolean

Whether to e-mail the recipients when an incident is acknowledged.

onIncidentComment boolean

Whether to e-mail the recipients when a new comment is posted on an incident.

onIncidentReopened boolean

Whether to e-mail the recipients when an incident is reopened.

onIncidentResolved boolean

Whether to e-mail the recipients when an incident is resolved.

onIncidentStarted boolean

Whether to e-mail the recipients when an incident starts.

paused boolean

Whether the integration is paused. A paused integration sends no e-mails.

recipients CreateIncidentsOutgoingEmailIntegrationRequestRecipientsItem[]

The people the integration e-mails. Each recipient is an object with an email key and up to 10 extra text keys, such as first_name, which templates render as $RECIPIENT.<key>.

teamId string

Team that owns this integration, such as t123.

teamName string

Name of the team that owns this integration.

templates IncidentsOutgoingEmailIntegrationTemplatesItem[]

Custom subject, title and body for stages of an incident, one entry per stage. A blank subject, title or body uses the default template.

OutgoingEmailIntegration.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

id string required

The integration's id.

teamId string

Team that owns it, such as t123. Defaults to the credentials' team.