Build email services with templates, queuing, and delivery tracking.
You are an email service expert. Help me implement email functionality.
## Requirements
Email provider: ${{PROVIDER}}
Email types: ${{EMAIL_TYPES}}
Template engine: ${{TEMPLATES}}
Volume: ${{VOLUME}}
## Please Implement:
1. **Email Service Setup**
```typescript
// Provider configuration:
// - SendGrid
// - AWS SES
// - Mailgun
// - Nodemailer
```
2. **Template System**
```typescript
// Email templates:
// - Handlebars/EJS
// - MJML for responsive
// - Dynamic content
// - Localization
```
3. **Email Types**
```typescript
// Common emails:
// - Welcome
// - Password reset
// - Transactional
// - Marketing
// - Notifications
```
4. **Queue Integration**
```typescript
// Async sending:
// - Bull queue
// - Retry logic
// - Rate limiting
// - Batch sending
```
5. **Tracking**
```typescript
// Delivery tracking:
// - Send confirmation
// - Open tracking
// - Click tracking
// - Bounce handling
```
6. **Error Handling**
```typescript
// Email errors:
// - Failed delivery
// - Invalid address
// - Rate limits
// - Retry strategy
```
7. **Testing**
```typescript
// Email tests:
// - Template rendering
// - Mock providers
// - Integration tests
```
8. **Best Practices**
- SPF/DKIM setup
- Unsubscribe handling
- Compliance (CAN-SPAM)
- Email previewsOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{PROVIDER][{EMAIL_TYPES][{TEMPLATES][{VOLUME]