mirror of
https://github.com/skoelle/icloud-contacts-sync.git
synced 2026-09-17 15:30:24 +00:00
birthday mail fullname when only 1 contact
This commit is contained in:
+4
-1
@@ -69,6 +69,9 @@ def build_message(account_name: str, birthdays: list[dict], target_date: date |
|
|||||||
msg.set_content("Heute hat niemand aus deinen Kontakten Geburtstag.")
|
msg.set_content("Heute hat niemand aus deinen Kontakten Geburtstag.")
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
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)}"
|
msg["Subject"] = f"Geburtstage heute ({today.isoformat()}): {len(birthdays)}"
|
||||||
|
|
||||||
plain_lines = [f"Heutige Geburtstage ({today.isoformat()}):", ""]
|
plain_lines = [f"Heutige Geburtstage ({today.isoformat()}):", ""]
|
||||||
@@ -154,7 +157,7 @@ def build_message(account_name: str, birthdays: list[dict], target_date: date |
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="padding:16px;">
|
<td style="padding:16px;">
|
||||||
<h1 style="font-size:20px;font-weight:600;color:#222;margin:0;">Geburtstage heute</h1>
|
<h1 style="font-size:20px;font-weight:600;color:#222;margin:0;">Geburtstage heute</h1>
|
||||||
<p style="font-size:13px;color:#666;margin:8px 0 16px 0;">{today.strftime('%d.%m.%Y')} · {len(birthdays)} Kontakte</p>
|
<p style="font-size:13px;color:#666;margin:8px 0 16px 0;">{today.strftime('%d.%m.%Y')} · {len(birthdays)} Kontakt{"e" if len(birthdays) != 1 else ""}</p>
|
||||||
<table width="100%" cellpadding="0" cellspacing="0">
|
<table width="100%" cellpadding="0" cellspacing="0">
|
||||||
{cards_html}
|
{cards_html}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user