Skip to content

Add email sink (SMTP or SendGrid) #6

Description

@YuyangXueEd

Summary

Add an email delivery sink so users can receive their daily digest directly in their inbox.

Why

Email is the most universally available notification channel. Many users don't have a Slack workspace or ServerChan account, but everyone has email. This is the highest-impact missing sink.

What to implement

A new sink at sinks/email/ that:

  • Sends the daily digest as an email with both plain-text and HTML parts
  • Supports two backends (contributor chooses one or both):
    • SMTP — works with Gmail, Outlook, Fastmail, self-hosted, etc.
    • SendGrid — simpler API, generous free tier
  • Reads credentials from environment variables:
    • SMTP: SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD
    • SendGrid: SENDGRID_API_KEY
  • Config options: to_address, from_address, subject_prefix, max_papers, max_hn, max_github

Config shape

sinks:
  email:
    enabled: false
    backend: smtp          # or "sendgrid"
    to: "you@example.com"
    from: "digest@example.com"
    subject_prefix: "[MyDailyUpdater]"
    max_papers: 5
    max_hn: 3
    max_github: 3

How to get started

  1. Copy sinks/_template/ to sinks/email/
  2. Look at sinks/slack/ as a reference for the delivery pattern
  3. Register in sinks/__init__.py
  4. Wire secrets into .github/workflows/daily.yml
  5. Write tests — mock the SMTP connection or SendGrid client
  6. Add sinks/email/README.md with setup instructions for both backends

Acceptance criteria

  • sinks/email/__init__.py with EmailSink class
  • sinks/email/README.md with setup instructions
  • At least one backend (SMTP or SendGrid) fully working
  • Registered in sinks/__init__.py
  • Config block in config/sources.yaml (commented out)
  • Secrets documented and wired into daily.yml
  • At least one test
  • pytest tests/ -q passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions