Email & Notifications
Delivery Diagnostics
Email delivery issues in StackFlow can occur at the SES sending layer, SNS delivery layer, or notification routing layer. Check the notification delivery log in Admin → Notifications → Delivery Log first to identify where in the pipeline delivery is failing. The log shows delivery attempts, SES message IDs, and bounce/complaint events.
- SES: Bounce/complaint notifications delivered to SNS topic
stackflow-ses-bounces-- subscribe to this for delivery failure alerts - CloudWatch Logs:
/aws/lambda/StackFlowEmailToTicketand/aws/lambda/StackFlowNotificationRouterlog groups - SES Dashboard: Monitor sending reputation score, bounce rate (<5%), and complaint rate (<0.1%) in SES console
- DynamoDB:
StackFlow_EmailTemplatetable -- verify all referenced template IDs exist before testing notification flows
SES Issues
| Symptom | Likely Cause | Diagnostic Step | Resolution |
|---|---|---|---|
| Emails not delivered | SES account in sandbox mode | Check SES sandbox status in AWS console | Request production SES access via AWS console |
| Bounced emails | Invalid recipient email address | Check SES bounce notifications in CloudWatch | Update user email address; add to SES suppression list |
| "Sending paused" error | SES account reputation issue | Check SES account health in AWS console | Review bounce/complaint rates; implement email list hygiene |
| Emails going to spam | Missing DKIM/SPF records | Use MXToolbox to check DNS records | Add SES DKIM CNAME records to DNS; verify SPF includes amazonses.com |
aws ses get-account-sending-enabled --region us-east-1
aws ses get-send-quota --region us-east-1
aws ses get-send-statistics --region us-east-1 | jq '.SendDataPoints[-1]'
SNS Delivery Issues
| Symptom | Likely Cause | Diagnostic Step | Resolution |
|---|---|---|---|
| SLA alerts not reaching on-call team | SNS subscription unconfirmed | Check SNS topic subscriptions — look for "PendingConfirmation" status | Re-subscribe and confirm the subscription endpoint |
| Webhook notifications failing | Target endpoint returning non-200 response | Enable SNS delivery status logging; check CloudWatch logs | Verify webhook endpoint is up and returning 200 |
| SNS messages backed up | Target endpoint slow (Lambda consumer) | Check SQS queue depth for Ingestion FIFO queue | Increase Lambda concurrency or optimize consumer processing |
Email-to-Ticket Issues
aws s3 ls s3://stackflow-email-inbox/inbound/ --region us-east-1 | tail -20
aws sqs get-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/373544523367/StackFlow-Events-Ingestion.fifo --attribute-names ApproximateNumberOfMessages,ApproximateNumberOfMessagesNotVisible --region us-east-1
Notification Template Errors
Template rendering errors occur when a notification template references a variable that doesn't exist in the triggering record. The error is logged to CloudWatch and the notification is skipped (not retried). Review template errors in Admin → Notifications → Template Errors. Common causes: a template was updated to reference a new field but the field doesn't exist in older record types, or a Jinja2 syntax error was introduced during template editing.
aws logs filter-log-events --log-group-name /aws/lambda/StackFlowAPI --filter-pattern '"template_render_error"' --start-time $(date -d '1 hour ago' +%s000) --region us-east-1