diff --git a/goodnews/digest.py b/goodnews/digest.py index b2a01bd..2b438f0 100644 --- a/goodnews/digest.py +++ b/goodnews/digest.py @@ -68,14 +68,21 @@ def build_digest(items: list[dict], brief_date: str, unsub_url: str, base: str | if weekday == "today": subject = f"Today's Upbeat Bytes · {n} calm reads" - text_lines = [f"Today's good news — {n} calm reads.\n"] + text_lines = [ + f"Upbeat Bytes — Daily Highlights", + f"{n} calm read{'' if n == 1 else 's'} for {weekday}.\n", + "Good morning. A small, hopeful handful of what's going right — and there's", + "always more waiting on the site whenever you want it.\n", + ] for it in items: text_lines.append(f"• {it['title']} ({it['source']})") if it.get("summary"): text_lines.append(f" {it['summary']}") + if it.get("reason_text"): + text_lines.append(f" Why it's here: {it['reason_text']}") text_lines.append(f" Read: {base}/a/{it['id']}") text_lines.append(f" Source: {it['canonical_url']}\n") - text_lines.append("That's today's good news. You're caught up — see you tomorrow.") + text_lines.append(f"That's today's highlights — more good news is always waiting at {base}. See you tomorrow.") text_lines.append(f"\nTo stop these emails: {unsub_url}") text = "\n".join(text_lines) @@ -97,11 +104,16 @@ def build_digest(items: list[dict], brief_date: str, unsub_url: str, base: str | html = ( '
{n} calm reads for {escape(weekday)}
' + '' + 'Good morning. A small, hopeful handful of what’s going right — and there’s always more ' + f'waiting on the site when you want it.
' + "".join(blocks) - + 'That’s today’s good news. ' - 'You’re caught up — see you tomorrow.
' + + 'That’s today’s highlights — more good news is ' + f'always waiting on Upbeat Bytes. See you tomorrow.
' f'You’re getting this because you turned on ' f'the daily digest. Unsubscribe.
' '