fix(email): init email service with SMTP-only when Azure credentials missing
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

This commit is contained in:
Maciej Pienczyn 2026-03-30 13:16:53 +02:00
parent 63f87ee951
commit 44031dd031

View File

@ -257,10 +257,15 @@ def init_email_service():
if tenant_id and client_id and client_secret:
_email_service = EmailService(tenant_id, client_id, client_secret, mail_from)
logger.info(f"Email Service initialized with sender: {mail_from}")
logger.info(f"Email Service initialized with Graph API, sender: {mail_from}")
return True
elif os.getenv('SMTP_USER') and os.getenv('SMTP_PASSWORD'):
# SMTP-only mode (no Azure) — create service with dummy Azure creds
_email_service = EmailService('dummy', 'dummy', 'dummy', mail_from)
logger.info(f"Email Service initialized with SMTP only, sender: {mail_from}")
return True
else:
logger.warning("Email Service not configured - missing Azure credentials")
logger.warning("Email Service not configured - missing Azure or SMTP credentials")
return False