Notifications And Email
Breyta notification guide for :notify and wait notifications, including email delivery via HTTP channels.
Goal
Send operational notifications and email alerts from flows using canonical notify config.
Quick Answer
Use flow/step :notify for external delivery (:http), and :wait {:notify ...} for approval notifications with action links.
Notify Step Pattern
(flow/step :notify :send-email
{:type :notify
:channels {:http {:connection :sendgrid
:path "/v3/mail/send"
:method :post
:json {:personalizations [{:to [{:email "{{recipient}}"}]}]
:from {:email "alerts@example.com"}
:subject "{{subject}}"
:content [{:type "text/plain" :value "{{message}}"}]}}}
:data {:recipient "ops@example.com"
:subject "Flow completed"
:message "Order {{order-id}} succeeded"}})
Wait Notification Pattern
(flow/step :wait :approval
{:key "approve:order:123"
:timeout "2h"
:notify {:channels {:http {:connection :sendgrid
:path "/v3/mail/send"
:method :post
:json {:personalizations [{:to [{:email "approver@example.com"}]}]
:from {:email "approvals@example.com"}
:subject "Approval required"
:content [{:type "text/plain"
:value "Approve: {{approval-url}}\nReject: {{rejection-url}}"}]}}}}})
Template Support
- channels support Handlebars values like
{{title}},{{message}},{{approval-url}} - wait notifications inject action URL variables automatically
- for reusable channel payloads, define a
:notificationtemplate in:templates
Current Channel Support
flow/step :notify::httponly (SendGrid, Slack, webhooks, custom APIs):wait {:notify ...}and checkpoint prompts: optional:http
Common Pitfalls
- missing
:channelsin notify step -> validation error - assuming wait approvals require in-app channels -> use
:httpnotifications with approval/rejection URLs - wrong connection slot in
:httpchannel -> auth/connection errors - expecting native
:emailchannel type -> use:httpwith an email provider API