Skip to main content

Email Automation Template

Drip Email Campaigns
Without Vendor Lock-In

Automated email sequences with SendGrid, Mailgun, or Postmark. JSON-based workflow configuration, intelligent scheduling, and complete control over your subscriber data. Easily customizable with a coding agent.

npm install -g codehooks
coho create mydrip --template drip-email-workflow
cd mydrip && coho deploy
# Your drip email system is live

No credit card required. Free tier for development. Set up your coding agent →

Email Automation Without the SaaS Tax

Mailchimp, ConvertKit, ActiveCampaign—they solve email automation but come with baggage:

  • $50/month for 500 subscribers, $300 for 10,000
  • Your subscribers locked in their database
  • Limited webhook integrations
  • Black box delivery—you never know why emails fail

Own your email automation with a self-hosted solution that scales.

Pre-Built Workflow Examples

3-Step DefaultStandard onboarding
Day 1, Day 4, Day 11
5-Step NurtureLead nurturing
Days 1, 3, 7, 14, 30
Daily CourseEmail courses
7 consecutive days
Aggressive OnboardingTrial conversion
1hr, 4hrs, 12hrs, 1d, 2d

Everything You Need for Automated Email Sequences

Production-ready drip campaigns with intelligent scheduling and full control

JSON-Based Workflow Config

Define unlimited email steps in a single config file. No code changes needed to add steps or modify timing.

Time-Based Scheduling

Send emails X hours after signup. Day 1, Day 3, Day 7—or aggressive onboarding at 1hr, 4hrs, 12hrs intervals.

Multiple Email Providers

SendGrid, Mailgun, or Postmark. Switch providers with a single environment variable. No vendor lock-in.

Automatic Duplicate Prevention

Atomic database operations ensure each subscriber receives each email exactly once, even with concurrent jobs.

Smart Rate Limiting & Retries

Intelligent rate limiting prevents API throttling. Failed emails retry automatically with exponential backoff.

Complete Audit Trail

Track every send with full logging. Dry-run mode lets you test workflows without sending real emails.

How Drip Campaigns Work

Cron-based scheduling ensures reliable, paced email delivery

Subscriber

Signs up

Cron Job

Every 15 min

Queue

Rate limited

Email Sent

Via provider

Automated flow: Subscriber added → Cron checks eligibility → Email queued with rate limiting → Delivered via SendGrid/Mailgun/Postmark

Simple JSON Configuration

Define your entire email sequence in one config file. Add steps, adjust timing, customize templates—all without touching code.

  • Unlimited workflow steps
  • Template placeholders: {{name}}, {{email}}
  • Custom subject, heading, body, button
  • Redeploy to apply changes instantly

stepsconfig.json:

{
"workflowSteps": [
{
"step": 1,
"hoursAfterSignup": 24,
"template": {
"subject": "Welcome to Our Community!",
"heading": "Hello {{name}}!",
"body": "Thanks for joining...",
"buttonText": "Get Started",
"buttonUrl": "https://example.com"
}
},
{
"step": 2,
"hoursAfterSignup": 72,
"template": {
"subject": "Quick tip for you",
"heading": "Did you know?",
"body": "Here's a pro tip..."
}
}
]
}

Choose Your Email Provider

Switch providers with a single environment variable

SendGrid

Industry standard for transactional email. Great deliverability and analytics.

SENDGRID_API_KEY

Mailgun

Developer-friendly with powerful APIs. Pay-as-you-go pricing.

MAILGUN_API_KEY

Postmark

Best-in-class deliverability. Perfect for transactional sequences.

POSTMARK_API_KEY

Built for Any Drip Campaign

From onboarding to courses to nurture sequences

User Onboarding

Welcome new users with a guided email sequence. Day 1 welcome, Day 3 tips, Day 7 feature highlight.

welcome • tips • features • success-stories

Email Courses

Deliver educational content over 7+ days. Each email builds on the last with a clear progression.

lesson-1 • lesson-2 • lesson-3 • graduation

Trial Conversion

Aggressive sequences to convert trial users. 1hr, 4hrs, 12hrs, Day 2, Day 4 touchpoints.

quick-start • value-prop • case-study • offer

Webhook-First Email Automation

Connect your drip campaigns to any webhook source—Stripe payments, signup forms, or custom events from your app.

Why webhook-driven? Traditional email platforms have limited integrations. With Codehooks, your drip campaign endpoint can receive webhooks from Stripe (new customer → onboarding sequence), signup forms (lead → nurture sequence), or any custom event from your application.

Read: Webhook-Driven Email Automation →

Ready to Automate Your Email Sequences?

Deploy a self-hosted drip email system in 5 minutes. Full control, no vendor lock-in, scales with your list.

Drip Email Campaign FAQ

Common questions about automated email sequences

What is a drip email campaign?
A drip email campaign is an automated sequence of emails sent to subscribers over time. Each email is triggered by a specific timing rule (e.g., 24 hours after signup, 3 days later, etc.). Drip campaigns are used for onboarding, nurturing leads, delivering courses, and re-engaging inactive users.
How do I set up automated email sequences?
With this template, you configure your sequence in a single JSON file. Define each step with hoursAfterSignup (when to send) and template (subject, body, button). Deploy with coho deploy and the system handles scheduling, sending, and tracking automatically.
Which email providers are supported?
Three production-ready providers: SendGrid, Mailgun, and Postmark. Each requires an API key and verified sender. Switch providers by changing one environment variable—your workflow configuration stays the same.
How does the scheduling work?
A cron job runs every 15 minutes, checking each workflow step. For each step, it finds subscribers who (1) signed up long enough ago and (2) haven't received that step yet. Emails are queued for delivery, ensuring consistent pacing and rate limit compliance.
Can I prevent duplicate emails?
Yes, automatically. The system uses atomic database operations: it marks the step as sent *before* queuing the email. Even if cron jobs overlap or run concurrently, each subscriber receives each email exactly once.
How do I handle large subscriber lists?
The template uses streaming architecture—it processes subscribers one at a time using database cursors instead of loading all into memory. This handles 10 to 100,000+ subscribers with constant memory usage.
What if an email fails to send?
Failed emails are logged with error details and automatically retry on the next cron cycle. The system also detects rate limit errors (HTTP 429) and backs off exponentially—5 minutes, then 15, then 30.
Can I test without sending real emails?
Yes! Set DRY_RUN=true in your environment. The entire workflow runs normally—subscribers are marked, logs are created—but no actual emails are sent. Perfect for validating configuration before going live.
How do I customize email templates?
Templates support placeholders like {{name}} and {{email}}. The HTML template is in a separate file (email-template.js) where you can customize CSS, layout, and branding. Each workflow step has its own subject, heading, body, and button.
Is this compliant with GDPR and CAN-SPAM?
The template includes built-in unsubscribe functionality via POST /subscribers/:id/unsubscribe. You own the subscriber data in your own database, making it easy to honor deletion requests and maintain compliance.