Send automatic email notifications when:
Lambda Content Moderation
↓ (if violation detected)
SNS Topic: ImageModerationAlerts
↓
├─→ SES: Email to Admin
└─→ SES: Email to User
SNS Topic is configured to distribute notifications to multiple subscribers:

Before sending emails, addresses must be verified in SES:

Subscriptions:
Message Format:
{
"articleId": "article-123",
"imageKey": "uploads/image.jpg",
"ownerId": "user-456",
"violationType": "explicit-content",
"severity": "high",
"action": "deleted",
"timestamp": "2025-12-08T10:30:00Z"
}

Subject: ⚠️ Content Moderation Alert - Image Violation Detected
Dear Admin,
An image has been flagged for content policy violation:
Article ID: {articleId}
Image: {imageKey}
Owner: {ownerId}
Violation Type: {violationType}
Severity: {severity}
Action Taken: {action}
Please review this case in the admin dashboard.
---
Travel Guide Moderation System
Subject: Your image was removed - Content Policy Violation
Hello,
We detected that one of your uploaded images violates our content policy:
Article ID: {articleId}
Violation Type: {violationType}
Action: Image has been removed
Please review our content guidelines and ensure future uploads comply with our policies.
If you believe this was a mistake, please contact support.
---
Travel Guide Team
def send_admin_notification(article_id, key, moderation_result, owner_id):
message = {
'articleId': article_id,
'imageKey': key,
'ownerId': owner_id,
'violationType': moderation_result['labels'],
'severity': moderation_result['maxSeverity'],
'action': 'deleted',
'timestamp': datetime.utcnow().isoformat()
}
sns.publish(
TopicArn=SNS_TOPIC_ARN,
Subject='⚠️ Content Moderation Alert',
Message=json.dumps(message)
)
✅ Admin Email:
✅ User Email:
Track important metrics:
Automated notification system: