status.health logo status.health logo status.health

Newsletter Backend Solution for status.health Blog

Newsletter Backend Solution for status.health Blog

Overview

To maintain a list of newsletter subscribers and notify them of new posts while keeping everything private, here are the best solutions:

Since you already have Substack integration:

Advantages:

  1. Privacy-focused - Substack takes privacy seriously
  2. Zero maintenance - They handle all infrastructure
  3. Built-in features:
    • Email list management
    • GDPR compliance
    • Unsubscribe handling
    • Analytics
    • RSS-to-email automation for new posts
  4. Free for small lists (up to 500 subscribers)
  5. Professional email delivery - High deliverability rates

Implementation:

  1. Keep current Substack embed/links
  2. Set up RSS-to-email in Substack:
    • Go to Settings → Publication details
    • Add your blog RSS feed: https://blog.status.health/feed.xml
    • Enable automatic emails for new posts

Alternative Solutions

1. Self-Hosted Solution with GitHub Actions + SendGrid

Privacy Level: Maximum

# .github/workflows/newsletter.yml
name: Newsletter
on:
  push:
    paths:
      - '_posts/*.md'
    branches:
      - main

jobs:
  notify-subscribers:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Send Newsletter
        env:
          SENDGRID_API_KEY: $
          SUBSCRIBER_LIST: $
        run: |
          # Custom script to send emails

Storage Options:

2. Privacy-Focused Email Services

Buttondown

ConvertKit

Mailjet

3. Serverless Solution with Netlify Functions

// netlify/functions/subscribe.js
exports.handler = async (event, context) => {
  const { email } = JSON.parse(event.body);
  
  // Store encrypted email in FaunaDB or similar
  // Send welcome email via SendGrid/Mailjet
  
  return {
    statusCode: 200,
    body: JSON.stringify({ success: true })
  };
};

4. GitHub-Based Solution (Most Private)

Structure:

private-newsletter-repo/
├── subscribers/
│   └── emails.encrypted.json
├── scripts/
│   ├── subscribe.js
│   ├── send-newsletter.js
│   └── encrypt.js
└── .github/
    └── workflows/
        └── new-post-notification.yml

Features:

Implementation Steps for GitHub + SendGrid

  1. Create private repository for subscriber data
  2. Set up SendGrid account (free tier: 100 emails/day)
  3. Create subscription endpoint:
// subscribe.js (Netlify Function)
const crypto = require('crypto');
const { Octokit } = require('@octokit/rest');

exports.handler = async (event) => {
  const { email } = JSON.parse(event.body);
  
  // Encrypt email
  const encrypted = encrypt(email);
  
  // Store in GitHub
  const octokit = new Octokit({
    auth: process.env.GITHUB_TOKEN
  });
  
  // Add to subscribers file
  await octokit.repos.createOrUpdateFileContents({
    owner: 'statusdothealth',
    repo: 'newsletter-subscribers',
    path: `subscribers/${Date.now()}.json`,
    message: 'Add subscriber',
    content: Buffer.from(encrypted).toString('base64')
  });
  
  return { statusCode: 200 };
};
  1. Create notification workflow:
# Send notification when new post is published
name: Notify Subscribers
on:
  push:
    paths:
      - '_posts/*.md'

jobs:
  send-emails:
    runs-on: ubuntu-latest
    steps:
      - name: Get new post details
      - name: Get subscriber list
      - name: Send emails via SendGrid

Privacy Considerations

  1. Data Minimization: Only collect email addresses
  2. Encryption: Always encrypt at rest
  3. Access Control: Limit who can access subscriber data
  4. Compliance:
    • GDPR compliance (EU)
    • CAN-SPAM compliance (US)
    • Clear privacy policy
    • Easy unsubscribe
  5. Data Location: Keep data in privacy-friendly jurisdictions

Recommendation

For immediate implementation with maximum privacy and minimum effort:

  1. Continue with Substack for now
  2. Set up RSS-to-email automation
  3. Consider migrating to Buttondown or self-hosted solution as you grow

For maximum privacy (more technical):

  1. Use GitHub private repo + GitHub Actions + SendGrid
  2. Implement encryption for all stored emails
  3. Build simple subscription/unsubscription flows

Would you like me to implement any of these solutions?