Orchestrate EventBridge rules to fan out business events (order placed, payment completed) to Twilio for SMS/WhatsApp and Resend for branded email delivery, then close the loop by ingesting returning delivery receipts, bounce notifications, and open tracking webhooks back through EventBridge for end-to-end notification status visibility.
Use this pipeline when your application requires reliable, multi-channel notifications triggered by domain events like OrderPlaced or PaymentCompleted, and you need end-to-end visibility by tracking delivery receipts, bounces, and opens back into your event bus for automated retries and analytics.
``bash aws events create-connection --name twilio-conn --authorization-type API_KEY --auth-parameters '{"ApiKeyAuthParameters":{"ApiKey":"TWILIO_SID","ApiSecretParameter":"TWILIO_TOKEN"}}' aws events create-api-destination --name twilio-sms --connection-arn <arn> --http-method POST --invocation-endpoint "https://api.twilio.com/2010-04-01/Accounts/{SID}/Messages.json" ``
``bash aws events create-connection --name resend-conn --authorization-type API_KEY --auth-parameters '{"ApiKeyAuthParameters":{"ApiKey":"RESEND_KEY"}}' aws events create-api-destination --name resend-email --connection-arn <arn> --http-method POST --invocation-endpoint "https://api.resend.com/emails" ``
``bash aws events put-rule --name "order-fanout" --event-pattern '{"source":["com.app"],"detail-type":["OrderPlaced"]}' aws events put-targets --rule "order-fanout" --targets '[{"Id":"sms","Arn":"<twilio-arn>","InputTransformer":{"InputPathsMap":{"p":"$.detail.phone","m":"$.detail.msg"},"InputTemplate":"{\"To\":\"<p>\",\"Body\":\"<m>\"}"}},{"Id":"email","Arn":"<resend-arn>","InputTransformer":{"InputPathsMap":{"e":"$.detail.email"},"InputTemplate":"{\"to\":\"<e>\",\"from\":\"[email protected]\",\"subject\":\"Order\",\"html\":\"<h1>Confirmed</h1>\"}"}}]' ``
/webhooks/twilio, /webhooks/resend) to receive async delivery callbacks.aws events put-events --entries '[{"Source":"com.notifications","DetailType":"DeliveryStatus","Detail":"{\"channel\":\"sms\",\"status\":\"delivered\",\"id\":\"SM123\"}"}]'
{"source":["com.notifications"],"detail-type":["DeliveryStatus","Bounce","Open"]} targeting RDS/OpenSearch.Domain events hit the EventBridge bus, where a fan-out rule routes payloads to Twilio and Resend via authenticated API Destinations. Providers process messages and POST delivery receipts to your webhook endpoints. These payloads are normalized and re-ingested into EventBridge via PutEvents, closing the loop. Downstream consumers (RDS, OpenSearch, Supabase) subscribe to tracking events for real-time visibility without polling.
events: and apigateway: permissionsOrderPlaced and DeliveryStatusX-Twilio-Signature or Resend HMAC verification exposes the pipeline to spoofed delivery events.InputTransformer must strictly match provider schemas. Missing From/To fields trigger silent 400s.Q: How does the closed-loop multi-channel notification pipeline handle message delivery and status tracking? A: The pipeline orchestrates EventBridge rules to fan out business events to Twilio for SMS or WhatsApp and Resend for branded email, then closes the loop by ingesting delivery receipts, bounce notifications, and open tracking webhooks back through EventBridge. This event-driven flow provides complete end-to-end visibility into notification status across all channels.