email-automation
Send automated emails, manage email campaigns, and handle email workflows. Use when needing email communication, notifications, or marketing automation.
Email Automation Skill
When to use this skill
Use this skill when you need to send emails automatically, manage email marketing campaigns, handle transactional emails, or create email-based workflows. Supports various email providers and template systems.
How to send emails
Basic Email Sending
- Configure: Set up SMTP connection and authentication
- Compose: Create email content with templates
- Send: Deliver emails with tracking and delivery confirmation
- Monitor: Track delivery status and handle bounces
Parameters
to(required): Recipient email address(es) - can be single email or arraysubject(required): Email subject linebody(optional): Email body content (HTML or plain text)template(optional): Template name for email formattingtemplate_data(optional): Data for template variable substitutioncc(optional): Carbon copy recipientsbcc(optional): Blind carbon copy recipientsattachments(optional): Array of file paths to attachpriority(optional): Email priority - "high", "normal", "low" (default: "normal")send_at(optional): Scheduled send time (ISO 8601 format)
Example
Request: "Send welcome email to new user"
Parameters: {
"to": "[email protected]",
"subject": "Welcome to Our Service!",
"template": "welcome-email",
"template_data": {
"first_name": "John",
"product_name": "Amazing Service"
},
"priority": "high"
}
Email Templates
Template System
Templates use variable substitution with {{variable}} syntax:
Welcome Template
<!DOCTYPE html>
<html>
<head>
<title>Welcome {{first_name}}!</title>
</head>
<body>
<h1>Welcome, {{first_name}}!</h1>
<p>Thank you for joining {{product_name}}.</p>
</body>
</html>
Newsletter Template
<html>
<body>
<h2>{{newsletter_title}}</h2>
<div>{{content}}</div>
<p>Unsubscribe: {{unsubscribe_link}}</p>
</body>
</html>
Password Reset Template
<html>
<body>
<h1>Password Reset Request</h1>
<p>Click here to reset: {{reset_link}}</p>
<p>Link expires: {{expiry_time}}</p>
</body>
</html>
Campaign Management
Bulk Email Sending
- Campaign setup: Define campaign parameters and goals
- Audience segmentation: Target specific user groups
- A/B testing: Test different subject lines and content
- Scheduling: Optimal send time determination
- Analytics: Track opens, clicks, and conversions
Campaign Parameters
campaign_name(required): Internal campaign identifieraudience_segment(optional): Target user segment criteriaab_test_config(optional): A/B test variationsschedule(optional): Send schedule and frequencyanalytics_tracking(optional): Enable click and open tracking (default: true)
Example
Request: "Launch product announcement campaign"
Parameters: {
"campaign_name": "product-launch-2024",
"audience_segment": "premium-users",
"ab_test_config": {
"subject_a": "Introducing Amazing Product!",
"subject_b": "You're Invited: Amazing Product Launch!"
},
"schedule": {
"send_time": "2024-03-15T09:00:00Z",
"timezone": "America/New_York"
}
}
Email Providers
Supported Providers
- SMTP: Generic SMTP server configuration
- Gmail: Gmail API integration
- Outlook: Microsoft Graph API
- SendGrid: Email delivery service
- Mailgun: Email API service
- AWS SES: Amazon Simple Email Service
Provider Configuration
{
"provider": "smtp",
"config": {
"host": "smtp.example.com",
"port": 587,
"use_tls": true,
"username": "[email protected]",
"password": "{{encrypted_password}}"
}
}
Delivery Management
Bounce Handling
- Hard bounces: Invalid email addresses
- Soft bounces: Temporary delivery issues
- Auto-unsubscribe: Remove invalid addresses
- Retry logic: Exponential backoff for failed sends
Analytics Integration
- Open tracking: Pixel tracking for email opens
- Click tracking: Link engagement measurement
- Conversion tracking: Goal completion measurement
- Geographic analytics: Location-based engagement data
Scripts and Tools
scripts/email-sender.py
Core email sending functionality:
- SMTP connection management
- Template rendering with Jinja2
- Attachment handling and encoding
- Delivery retry logic
scripts/campaign-manager.py
Email campaign orchestration:
- Audience segmentation
- A/B test execution
- Scheduling and queue management
- Performance analytics
scripts/template-engine.py
Template processing system:
- Variable substitution and validation
- Multi-language support
- Conditional content blocks
- Dynamic content generation
scripts/analytics-tracker.py
Email performance tracking:
- Open rate calculation
- Click-through analysis
- Conversion funnel tracking
- Geographic and device analytics
Security Features
Authentication & Security
- API key management: Secure credential storage
- Rate limiting: Prevent abuse and ensure deliverability
- Content scanning: Spam detection and prevention
- Encryption: TLS/SSL for secure transmission
Compliance
- GDPR: Data protection and consent management
- CAN-SPAM: Canadian anti-spam compliance
- CASL: Commercial email best practices
- Unsubscribe: Easy opt-out mechanisms
Error Handling
Common Issues
- Authentication failures: Invalid credentials or expired tokens
- Rate limiting: Too many requests in time window
- Content blocks: Spam filter triggers
- Bounce processing: Invalid or unreachable addresses
Recovery Strategies
- Fallback providers: Alternate sending routes
- Queue management: Delayed retry for failed sends
- Alert notifications: Admin alerts for critical failures
- Manual review: Queue problematic emails for human review
This skill provides comprehensive email automation capabilities with enterprise-grade features for transactional and marketing email workflows.