A Strapi plugin that allows sending bulk email campaigns using HTML templates.
npm install strapi-plugin-email-bulk-senderA Strapi plugin that allows sending bulk email campaigns using HTML templates.
Email Bulk Sender is a Strapi v5 plugin that provides functionality for mass sending personalized email messages. The plugin includes:
- Administrative interface for selecting recipients and templates
- Template system with variable support
- Bulk sending with result tracking
- Security with template path validation
- π§ Bulk email sending with rate limiting
- π¨ HTML template support with variables
- π₯ Recipient selection from various collections
- π Send result tracking
- π Secure template file handling and authentication
- π― Message personalization
- β
Email validation
- β‘ Configurable rate limiting
1. Ensure the plugin is located in the src/plugins/strapi-plugin-email-bulk-sender/ folder
2. The plugin is automatically loaded by Strapi on startup
Add configuration to the config/plugins.ts file:
``typescript`
export default {
// ... other plugins
'strapi-plugin-email-bulk-sender': {
enabled: true,
resolve: './src/plugins/strapi-plugin-email-bulk-sender'
},
// ... other settings
}
Ensure that an email provider is configured in Strapi. Add configuration to config/plugins.ts:
`typescript`
export default {
// ... other plugins
email: {
config: {
provider: 'nodemailer', // or another provider
providerOptions: {
// provider settings
},
settings: {
defaultFrom: 'noreply@yourdomain.com',
defaultReplyTo: 'noreply@yourdomain.com',
},
},
},
// ... other settings
}
By default, the plugin looks for templates in the templates/ folder in the project root. You can customize various settings:
`typescript`
export default {
// ... other plugins
'strapi-plugin-email-bulk-sender': {
enabled: true,
resolve: './src/plugins/strapi-plugin-email-bulk-sender',
config: {
emailTemplate: {
enabled: true,
path: 'templates', // path to templates folder
rateLimitDelay: 2000 // delay between emails in milliseconds (default: 1000)
}
}
},
// ... other settings
}
#### Configuration Options
- enabled: Enable/disable the email template functionality (default: true)path
- : Path to the templates folder relative to project root (default: 'templates')rateLimitDelay
- : Delay between email sends in milliseconds to prevent SMTP rate limiting (default: 1000)
1. Create HTML files in the templates/ folder{{variableName}}
2. Use variables in the format {{email}}
3. Available variables:
- - recipient's email{{name}}
- - recipient's name{{company}}
- Any additional fields from your document data (e.g., , {{position}}, etc.)
Example template (templates/welcome.html):
` Your email: {{email}} Welcome to our platform!html`
Hello {{name}}!
1. Go to the Strapi admin panel
2. Open the list of users in Content Manager
3. Select recipients from available users using checkboxes
4. The βSend emailβ button will appear. Click it.
5. Choose a template for sending
6. Click "Send emails"
#### Get Templates List
``
GET /api/strapi-plugin-email-bulk-sender/templates
#### Get Template Content
``
GET /api/strapi-plugin-email-bulk-sender/templates/:templatePath
#### Send Bulk Emails
``
POST /api/strapi-plugin-email-bulk-sender/send-bulk-emails
Request body:
`json`
{
"template": "welcome",
"documents": [
{
"id": 1,
"email": "user@example.com",
"name": "John Doe"
}
]
}
The plugin includes several security measures:
- Authentication Required: All email sending endpoints require admin authentication
- Email Validation: All email addresses are validated before sending
- Template Path Security: Template paths are validated to prevent directory traversal attacks
- Rate Limiting: Configurable delays between emails to prevent SMTP abuse
- Input Validation: Comprehensive validation of all input parameters
``
src/plugins/strapi-plugin-email-bulk-sender/
βββ admin/ # Administrative interface
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Admin pages
β β βββ utils/ # Utilities
βββ server/ # Server-side
β βββ src/
β β βββ controllers/ # API controllers
β β βββ routes/ # Routes
β β βββ services/ # Services
β β βββ config/ # Configuration
βββ package.json
βββ README.md
`bash`
npm run build
`bash`
npm run watch
`bash``
npm run test:ts:front # for admin
npm run test:ts:back # for server
- Strapi v5.23.3
- Node.js 18+
- Configured email provider in Strapi
MIT License
denisgrushkin