Plunk
Send transactional and marketing email with Plunk. Use this skill when the project needs to integrate Plunk for open-source email, transactional sends, automated sequences, contact management, or self-hosted email infrastructure. Covers the Plunk API, events-based email triggers, automations, contacts, and self-hosting.
You are an email operations specialist who integrates Plunk into projects. Plunk is an open-source email platform that can be self-hosted or used as a managed service. It focuses on event-driven email with automations and contact tracking. ## Key Points 1. **Trigger**: Event name (e.g., `user-signup`) 2. **Delay**: Optional wait period (e.g., 1 hour, 3 days) 3. **Action**: Send email template with event data as variables - `user-signup` → Send welcome email immediately - `user-signup` → Wait 3 days → Send onboarding tips - `user-signup` → Wait 7 days → Send feature highlights - `trial-ending` → Send trial ending reminder immediately - `DATABASE_URL` — PostgreSQL connection string - `REDIS_URL` — Redis connection string - `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION` — For SES sending - `JWT_SECRET` — For dashboard authentication - `APP_URI` — Public URL of your Plunk instance ## Quick Example ```bash npm install @plunk/node ``` ```typescript import Plunk from '@plunk/node'; const plunk = new Plunk(process.env.PLUNK_API_KEY); ```
skilldb get email-services-skills/plunkFull skill: 160 linesPlunk Email Integration
You are an email operations specialist who integrates Plunk into projects. Plunk is an open-source email platform that can be self-hosted or used as a managed service. It focuses on event-driven email with automations and contact tracking.
Core Philosophy
Events drive everything
Plunk's model is event-based. Instead of calling "send email", you track events on contacts, and automations react to those events. This inverts the typical send-first mental model and creates cleaner, more maintainable email workflows.
Open source means you own your data
Self-hosted Plunk keeps all contact data, email content, and analytics on your infrastructure. No vendor lock-in for contact lists or template history.
Automations replace ad-hoc sends
Instead of scattering send calls throughout your codebase, define automations in Plunk's dashboard. Application code just fires events — Plunk handles the rest.
Setup
Install
npm install @plunk/node
Initialize
import Plunk from '@plunk/node';
const plunk = new Plunk(process.env.PLUNK_API_KEY);
Key Techniques
Transactional send
Direct sends bypass automations — use for immediate transactional email.
await plunk.emails.send({
to: 'user@example.com',
subject: 'Your password reset link',
body: '<p>Click <a href="...">here</a> to reset your password.</p>',
});
Track events (trigger automations)
Track events on contacts, and automations fire based on those events.
// Track a signup event — triggers welcome automation
await plunk.events.track({
email: 'user@example.com',
event: 'user-signup',
data: {
name: 'Alice',
plan: 'free',
},
});
// Track a purchase — triggers receipt automation
await plunk.events.track({
email: 'user@example.com',
event: 'purchase-completed',
data: {
amount: '$29.00',
plan: 'Pro',
invoiceId: 'inv_123',
},
});
Contact management
// Create or update contact
await plunk.contacts.create({
email: 'user@example.com',
data: {
name: 'Alice',
plan: 'pro',
company: 'Acme Inc',
},
});
// Get contact
const contact = await plunk.contacts.get('user@example.com');
// Update subscription
await plunk.contacts.subscribe('user@example.com');
await plunk.contacts.unsubscribe('user@example.com');
Automations (configured in dashboard)
Automations are created in Plunk's dashboard, not code:
- Trigger: Event name (e.g.,
user-signup) - Delay: Optional wait period (e.g., 1 hour, 3 days)
- Action: Send email template with event data as variables
Example automation chain:
user-signup→ Send welcome email immediatelyuser-signup→ Wait 3 days → Send onboarding tipsuser-signup→ Wait 7 days → Send feature highlightstrial-ending→ Send trial ending reminder immediately
Self-hosting
# Docker Compose
git clone https://github.com/useplunk/plunk.git
cd plunk
cp .env.example .env
# Edit .env with your SMTP relay (SES, Postmark, etc.)
docker compose up -d
Required environment variables for self-hosted:
DATABASE_URL— PostgreSQL connection stringREDIS_URL— Redis connection stringAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_REGION— For SES sendingJWT_SECRET— For dashboard authenticationAPP_URI— Public URL of your Plunk instance
Event-Driven Architecture
| Application Event | Plunk Event | Automation |
|---|---|---|
| User signs up | user-signup | Welcome email + onboarding sequence |
| Trial started | trial-started | Trial tips, day 7 reminder, day 13 ending soon |
| Payment success | payment-success | Receipt email |
| Payment failed | payment-failed | Payment failed alert |
| Feature used | feature-used | Activation email (first use only) |
| User inactive 30d | user-inactive | Win-back email |
Best Practices
- Use events for all email triggers — keep send calls out of business logic
- Define automation chains for lifecycle email (welcome → onboard → convert)
- Store business data in event payloads for template personalization
- Use contact data fields for segmentation in campaigns
- Self-host for full data ownership and GDPR compliance
- Test automations with a staging Plunk instance before production
Anti-Patterns
- Bypassing events and using direct sends for everything — defeats the automation model
- Not passing data in event payloads — templates can't personalize
- Creating complex automation logic in application code instead of Plunk's automation builder
- Self-hosting without a reliable SMTP relay (SES, Postmark, etc.)
- Not setting up contact unsubscribe flows for marketing automation
Install this skill directly: skilldb add email-services-skills
Related Skills
Postmark
Send transactional email with Postmark. Use this skill when the project needs to integrate Postmark for high-deliverability transactional email, server-side templates, inbound email processing, message streams, bounce handling, or DMARC reporting. Covers the Postmark API, template system, message streams, webhooks, and deliverability features.
React Email
Build email templates with React Email. Use this skill when the project needs to create type-safe, component-based email templates using React, preview emails during development, render to HTML for any email provider, or build a shared email design system. Covers React Email components, preview server, rendering, and integration with Resend, SendGrid, Postmark, AWS SES, and Nodemailer.
Resend
Send transactional and marketing email with Resend. Use this skill when the project needs to integrate Resend for sending email, managing contacts, handling webhooks, building templates, or setting up mailing lists and broadcasts. Covers single sends, batch sends, scheduling, React Email templates, domain verification, webhook processing, idempotency, deliverability, and compliance.
Sendgrid
Send transactional and marketing email with SendGrid (Twilio). Use this skill when the project needs to integrate SendGrid for sending email via API or SMTP, dynamic templates, contact management, marketing campaigns, email validation, webhook event processing, or deliverability optimization. Covers the v3 Mail Send API, dynamic transactional templates, Marketing Campaigns, suppressions, and Event Webhook.
Sparkpost
Send transactional and marketing email with SparkPost (now MessageBird). Use this skill when the project needs to integrate SparkPost for high-volume email delivery via REST API or SMTP, recipient lists, stored templates, A/B testing, engagement tracking, suppression management, webhooks, and deliverability analytics.
AWS Ses
Send email at scale with Amazon SES (Simple Email Service). Use this skill when the project needs to integrate AWS SES for transactional email, bulk sending, email receiving, configuration sets, event publishing, dedicated IPs, custom MAIL FROM domains, or cost-optimized high-volume email. Covers the SES v2 API, templates, configuration sets, event destinations, and deliverability dashboard.