diff --git a/src/mailer.py b/src/mailer.py index 4f800a8..7c8e2a3 100644 --- a/src/mailer.py +++ b/src/mailer.py @@ -69,7 +69,10 @@ def build_message(account_name: str, birthdays: list[dict], target_date: date | msg.set_content("Heute hat niemand aus deinen Kontakten Geburtstag.") return msg - msg["Subject"] = f"Geburtstage heute ({today.isoformat()}): {len(birthdays)}" + if len(birthdays) == 1: + msg["Subject"] = f"Geburtstage heute ({today.isoformat()}): {birthdays[0]['full_name']}" + else: + msg["Subject"] = f"Geburtstage heute ({today.isoformat()}): {len(birthdays)}" plain_lines = [f"Heutige Geburtstage ({today.isoformat()}):", ""] for b in birthdays: @@ -154,7 +157,7 @@ def build_message(account_name: str, birthdays: list[dict], target_date: date |

Geburtstage heute

-

{today.strftime('%d.%m.%Y')} · {len(birthdays)} Kontakte

+

{today.strftime('%d.%m.%Y')} · {len(birthdays)} Kontakt{"e" if len(birthdays) != 1 else ""}

{cards_html}