mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
feat(unsubscribe): RFC 8058 one-click unsubscribe on feed deletion
Capture each sender's List-Unsubscribe one-click URL during ingestion (stored per sender in feed metadata, mirroring the iconDomain pattern) and fire one-click POSTs via ctx.waitUntil when a feed is deleted, so newsletters stop mailing the now-dead address. Tracked with a new unsubscribes_sent counter surfaced on the status page and /api/stats. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,9 @@ export interface FeedConfig {
|
||||
export interface FeedMetadata {
|
||||
emails: EmailMetadata[];
|
||||
iconDomain?: string; // Most recent sender's domain, used to resolve the feed icon
|
||||
// RFC 8058 one-click unsubscribe URLs, keyed by sender so each newsletter on
|
||||
// the feed keeps its own (latest) link; fired when the feed is deleted.
|
||||
unsubscribe?: Record<string, string>;
|
||||
}
|
||||
|
||||
// Email metadata interface (summary info for listing)
|
||||
@@ -76,6 +79,7 @@ export interface Counters {
|
||||
feeds_deleted: number;
|
||||
emails_received: number;
|
||||
emails_rejected: number;
|
||||
unsubscribes_sent: number;
|
||||
last_email_at?: string; // ISO 8601
|
||||
last_feed_created_at?: string; // ISO 8601
|
||||
first_seen?: string; // ISO 8601 — first time counters were written (instance start)
|
||||
|
||||
Reference in New Issue
Block a user