events: discard notification if user has empty email (#8938)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -452,6 +452,13 @@ class NotificationTransport(SerializerModel):
|
|||||||
|
|
||||||
def send_email(self, notification: "Notification") -> list[str]:
|
def send_email(self, notification: "Notification") -> list[str]:
|
||||||
"""Send notification via global email configuration"""
|
"""Send notification via global email configuration"""
|
||||||
|
if notification.user.email.strip() == "":
|
||||||
|
LOGGER.info(
|
||||||
|
"Discarding notification as user has no email address",
|
||||||
|
user=notification.user,
|
||||||
|
notification=notification,
|
||||||
|
)
|
||||||
|
return None
|
||||||
subject_prefix = "authentik Notification: "
|
subject_prefix = "authentik Notification: "
|
||||||
context = {
|
context = {
|
||||||
"key_value": {
|
"key_value": {
|
||||||
|
|||||||
Reference in New Issue
Block a user