pushEventFor maps a recipient status to its webhook event type, or "" for statuses with no push event (queued/sent/deferred/failed — poll instead).
(s Status)
| 41 | // pushEventFor maps a recipient status to its webhook event type, or "" for |
| 42 | // statuses with no push event (queued/sent/deferred/failed — poll instead). |
| 43 | func pushEventFor(s Status) string { |
| 44 | switch s { |
| 45 | case StatusDelivered: |
| 46 | return EventEmailDelivered |
| 47 | case StatusBounced: |
| 48 | return EventEmailBounced |
| 49 | case StatusComplained: |
| 50 | return EventEmailComplained |
| 51 | } |
| 52 | return "" |
| 53 | } |
| 54 | |
| 55 | // Consumer applies a parsed SES Event to the store: per-recipient transitions, |
| 56 | // delivery events, and auto-suppression. It is idempotent end-to-end (safe to |