fix: use NetBox SMTP sender address

This commit is contained in:
2026-07-29 12:26:57 +02:00
parent 157c891cde
commit 919b2d01e5
4 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -81,7 +81,8 @@ class LicenseExpirationNotificationJob(JobRunner):
body += "\n" + _("Provider portal: %(url)s") % {"url": license.provider_portal_url}
try:
send_mail(subject, body, settings.DEFAULT_FROM_EMAIL, [user.email], fail_silently=False)
from_email = settings.SERVER_EMAIL or settings.EMAIL_HOST_USER
send_mail(subject, body, from_email, [user.email], fail_silently=False)
except Exception:
self.logger.exception(f"Failed to send expiration email for license {license.pk} to user {user}")
else: