BatchMail provides an interface for generating personalized email HTML bodies from a CSV file and a Jinja-style HTML template (rendered client-side with Nunjucks).
- Upload CSV (with headers) and auto-detect recipient and name columns.
- Map columns manually if auto-detection is wrong.
- Create or upload an HTML template containing variables like
{{ name }}or any header (e.g.{{ company }}). - Preview the first few rendered emails safely in sandboxed iframes.
- Export a JSON payload:
[ { to, name, html }, ... ]for further processing / sending via your backend.
The CSV must include a header row. Common column names auto-detected:
- Recipient/email:
email,recipient,to,address - Name:
name,full_name,first_name
Other columns are available as template variables automatically.
Example:
email,name,company
alice@example.com,Alice,Wonder Corp
bob@example.com,Bob,Builder LLCUses Nunjucks (close to Jinja):
- Variables:
{{ name }},{{ company }} - Conditionals:
{% if company %}...{% endif %} - Loops:
{% for r in rows %}...{% endfor %}(You typically won't loop here; each render is per row.)
Minimal example:
<html>
<body>
<p>Hello {{ name }},</p>
<p>We love working with {{ company }}.</p>
</body>
</html>npm install
npm run devClick "Export JSON" to download batchmail-payload.json:
You can POST the exported JSON to a backend that sends emails (e.g. using Nodemailer, AWS SES, SendGrid). Ensure you sanitize or trust the template source before sending.
- Client-only rendering; no data is sent server-side during preview.
- If your CSV is large, consider implementing pagination/virtualization.
- For security, the preview iframes are sandboxed; remove sandbox restrictions only if you trust the template content.
MIT
[ { "to": "alice@example.com", "name": "Alice", "html": "<html>... personalized ...</html>" } ]