diff --git a/tools/email_digest.py b/tools/email_digest.py index eccde6b..b2ce8eb 100644 --- a/tools/email_digest.py +++ b/tools/email_digest.py @@ -98,12 +98,14 @@ def run_digest(): print("📬 Verific emailuri necitite...") saved = save_unread_emails() + owner_jid = get_owner_jid() + if not saved: print("Niciun email nou de procesat.") + if not DRY_RUN: + send_whatsapp(owner_jid, "📭 Nu sunt emailuri noi.") return - owner_jid = get_owner_jid() - for result in saved: if not result.get("ok"): print(f"⚠️ Sărit: {result.get('error')}") diff --git a/tools/email_forward.py b/tools/email_forward.py index eec6c93..f7a46f9 100644 --- a/tools/email_forward.py +++ b/tools/email_forward.py @@ -148,12 +148,14 @@ def run_forward(): print("Verific emailuri necitite...") emails = fetch_unread_emails() + owner_jid = get_owner_jid() + if not emails: print("Niciun email nou de procesat.") + if not DRY_RUN: + send_whatsapp(owner_jid, "📭 Nu sunt emailuri noi.") return - owner_jid = get_owner_jid() - for em in emails: subject = em['subject'] print(f"Trimit: {subject}")