✅ Complete email management system for HabitStack Push weekly newsletters
✅ 8 edition files imported from CSV (editions 34-41)
✅ All scripts created and tested:
- Import from CSV
- Generate HTML emails
- Schedule via SendGrid API
- Status checking
- Edition listing
Edit config.yaml and add your SendGrid configuration:
sendgrid:
name_prefix: "HS Push - "
sender_id: YOUR_SENDER_ID # Get from SendGrid dashboard
suppression_group_id: YOUR_GROUP_ID
# Production lists (for --live mode)
list_ids: ["your-production-list-id"]
segment_ids: ["your-production-segment-id"] # Optional
# Test lists (for default test mode)
test_list_ids: ["your-test-list-id"]
test_segment_ids: [] # Optional
email:
subject_prefix: "🕗 Plan your week // "The script will prompt for your API key if not set. To avoid the prompt, set it in your environment:
export SENDGRID_API_KEY='your-sendgrid-api-key-here'To make it permanent, add to your ~/.bashrc or ~/.zshrc:
echo 'export SENDGRID_API_KEY="your-sendgrid-api-key-here"' >> ~/.bashrc
source ~/.bashrcruby scripts/status.rb# Build just edition 34 for testing
ruby scripts/build_emails.rb \
--start 34 \
--end 34 \
--start-date 2025-11-25 \
--start-time 0800# List queued files
ls -lh queued/
# Open in browser to preview
# (Replace with your preferred browser)
firefox queued/2025-11-25-0800-edition-34-*.html
# or
google-chrome queued/2025-11-25-0800-edition-34-*.htmlVerify:
- Quote displays correctly
- Coaching content is properly formatted
- Cartoon image loads
- All links work
IMPORTANT: Before running this, make sure:
- SendGrid test lists are configured in config.yaml
- You've reviewed the HTML and it looks perfect
# TEST MODE - Schedule to test list (default)
ruby scripts/schedule_emails.rbThe script will prompt for your API key if not already set in environment.
After verifying test email in SendGrid:
# PRODUCTION MODE - Schedule to production lists
ruby scripts/schedule_emails.rb --live- Go to https://app.sendgrid.com/marketing/singleSends
- Find your scheduled email (named "HS Push - YYYY-MM-DD HH:MM - Edition XX")
- Verify the email is scheduled for the correct date/time
- Check the recipient list (should be test list first)
- Send a test email to yourself if possible
- After verifying test, delete test schedule and run with
--liveflag
# View the log file
ls -lt logs/
cat logs/schedule_*.logSchedule multiple editions at once:
# Build editions 35-40, starting Nov 24
ruby scripts/build_emails.rb \
--start 35 \
--end 40 \
--start-date 2025-11-24 \
--start-time 0800
# Review built HTML files
ls queued/
# Schedule to test list first
ruby scripts/schedule_emails.rb
# After verifying in SendGrid, schedule to production
ruby scripts/schedule_emails.rb --liveTwo options:
Option A: Add to CSV and Import
- Update your Monday/Zapier CSV export
- Run:
ruby scripts/csv_to_markdown.rb new_export.csv - Manually add andertoon numbers to new files
Option B: Create Manually
- Copy an existing edition file as template
- Update all front matter fields
- Write new content
- Save as
editions/edition-XX-subject-suffix.md
# Check what you have
ruby scripts/list_editions.rb
# Check system status
ruby scripts/status.rb
# Clean up old logs (optional)
ls -lt logs/
# Delete old logs if needed# System status
ruby scripts/status.rb
# List all editions
ruby scripts/list_editions.rb
# Get help
ruby scripts/help.rb
# Import from CSV
ruby scripts/csv_to_markdown.rb [filename.csv]
# Build emails
ruby scripts/build_emails.rb \
--start N --end M \
--start-date YYYY-MM-DD \
--start-time HHMM
# Schedule emails (test mode)
ruby scripts/schedule_emails.rb
# Schedule emails (production mode)
ruby scripts/schedule_emails.rb --liveRun: ruby scripts/csv_to_markdown.rb
Edit config.yaml and set your test_list_ids
Edit config.yaml and set your list_ids and segment_ids
Either enter it when prompted, or set: export SENDGRID_API_KEY='your-key'
- Check logs in
logs/directory - Files remain in
queued/until successfully scheduled - Fix issue and re-run schedule script
- Read the full
README.mdfor detailed documentation - Run
ruby scripts/help.rbfor quick reference - Contact: sw@habitstack.com
- ✅ Test with one email first
- ✅ Verify in SendGrid dashboard
- ✅ Schedule your next batch
- Consider: Export fresh CSV to get latest editions
- Consider: Add automation for LinkedIn posts
Ready to send your first email? Start with Step 1 above!