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:
Recommended Solution: Substack (Current Integration)
Since you already have Substack integration:
Advantages:
- Privacy-focused - Substack takes privacy seriously
- Zero maintenance - They handle all infrastructure
- Built-in features:
- Email list management
- GDPR compliance
- Unsubscribe handling
- Analytics
- RSS-to-email automation for new posts
- Free for small lists (up to 500 subscribers)
- Professional email delivery - High deliverability rates
Implementation:
- Keep current Substack embed/links
- 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:
- Encrypted JSON in private GitHub repo
- GitHub Secrets for subscriber list
- Self-hosted database with encryption
2. Privacy-Focused Email Services
Buttondown
- Privacy-first email newsletter service
- GDPR compliant
- Simple API
- $9/month for up to 1,000 subscribers
- Features: Custom domains, analytics, automation
ConvertKit
- Strong privacy controls
- Advanced automation
- $15/month for up to 300 subscribers
- Good for growth
Mailjet
- European company (GDPR-native)
- Pay-as-you-go pricing
- Strong privacy features
- API-first approach
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:
- Emails stored encrypted in private repo
- GitHub Actions for automation
- SendGrid/Mailjet for sending
- Complete control over data
Implementation Steps for GitHub + SendGrid
- Create private repository for subscriber data
- Set up SendGrid account (free tier: 100 emails/day)
- 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 };
};
- 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
- Data Minimization: Only collect email addresses
- Encryption: Always encrypt at rest
- Access Control: Limit who can access subscriber data
- Compliance:
- GDPR compliance (EU)
- CAN-SPAM compliance (US)
- Clear privacy policy
- Easy unsubscribe
- Data Location: Keep data in privacy-friendly jurisdictions
Recommendation
For immediate implementation with maximum privacy and minimum effort:
- Continue with Substack for now
- Set up RSS-to-email automation
- Consider migrating to Buttondown or self-hosted solution as you grow
For maximum privacy (more technical):
- Use GitHub private repo + GitHub Actions + SendGrid
- Implement encryption for all stored emails
- Build simple subscription/unsubscription flows
Would you like me to implement any of these solutions?