Default language code: en, de, fr, es, it, nl, pt, pl, sv, he
preview.port
number?
Port for the live preview server (default: 3001)
Warning
Never commit your apiKey to version control. Use environment variables instead — see the Environment Variables section.
Medusa v2 Integration
Guralnik Mailer integrates seamlessly with Medusa v2. The SmartMedusaAdapter automatically listens to 22 Medusa events and dispatches the correct email template — zero subscriber logic required.
Step 1 — Install in your Medusa project
Terminal
1npm install guralnik-mailer
Step 2 — Create the subscriber file
Create a new subscriber file in your Medusa project. The adapter handles everything automatically:
Every template ships with translations for 10 languages. Guralnik Mailer automatically selects the correct language based on the locale field when sending.
ENEnglish
DEDeutsch
FRFrançais
ESEspañol
ITItaliano
NLNederlands
PTPortuguês
PLPolski
SVSvenska
HEעברית
Per-Email Language Override
Pass locale in the data object to override the default language for a specific email:
Hebrew (he) automatically enables right-to-left (RTL) layout in all templates.
Template Reference
Guralnik Mailer includes 19 production-ready templates organized into 4 categories. Each template is fully responsive, theme-aware, and available in all 10 languages.
Guralnik Mailer includes a built-in live preview server so you can view every template locally before sending. It supports hot reload, theme switching, and test email sending.
Start the Preview Server
Terminal
1npx guralnik-mailer preview
This starts a local server at http://localhost:3001 (configurable via preview.port in your config).
Features
Template browser — browse all 19 templates in a sidebar
Live theme switching — toggle between themes in real-time
Desktop/Mobile toggle — test responsive layouts
Send test emails — dispatch a test email to any address directly from the preview
Hot reload — changes to your config are reflected instantly
Tip
The preview server is development-only and not included in production builds. It's safe to always have it configured.
Environment Variables
For production, you should use environment variables instead of hardcoding secrets in your config file. Guralnik Mailer automatically reads from .env.
.env
1# Email provider API key2MAILER_API_KEY=re_your_api_key_here
34# Optional overrides5MAILER_FROM="Your Brand <hello@your-domain.com>"6MAILER_REPLY_TO=support@your-domain.com
78# SMTP-specific (only if using SMTP provider)9SMTP_HOST=smtp.gmail.com
10SMTP_PORT=587
11SMTP_USER=your-email@gmail.com
12SMTP_PASS=your-app-password
When environment variables are set, they automatically override the corresponding values in mailer.config.json. Your config file can then omit sensitive values:
Always add .env to your .gitignore. Never commit API keys or credentials to version control.
FAQ
QDo I need Medusa to use Guralnik Mailer?
No. Guralnik Mailer works standalone with any Node.js project. The Medusa adapter is optional — you can use mailer.send() directly in Express, Fastify, Next.js API routes, or any backend.
QCan I customize the HTML templates?
Yes. All templates are React-based (using React Email under the hood). You can extend or override individual templates by placing custom versions in your project.
QIs it free?
Yes. Guralnik Mailer is open-source under the MIT license. It's free to use in personal and commercial projects.
QWhich email providers require paid plans?
That depends on the provider. Resend offers a generous free tier (100 emails/day). SendGrid also has a free tier. AWS SES is pay-per-use at $0.10/1000 emails. SMTP depends on your server.
QCan I add custom translations?
Yes. You can override or extend the built-in translations by providing custom translation files in your project. See the GitHub repository for the translation file format.
QDoes it support attachments?
Yes. You can pass attachments in the options parameter of mailer.send(). Attachments support buffers, streams, and file paths.
QWhat about email deliverability?
Deliverability depends on your email provider and domain configuration (SPF, DKIM, DMARC). Guralnik Mailer generates clean, standards-compliant HTML that renders correctly across all major email clients.
Ready to start?
Install the package and send your first email in under a minute.