diff --git a/authentik/stages/email/utils.py b/authentik/stages/email/utils.py index 5422ec43a..5b2637662 100644 --- a/authentik/stages/email/utils.py +++ b/authentik/stages/email/utils.py @@ -1,6 +1,7 @@ """email utils""" from email.mime.image import MIMEImage from functools import lru_cache +from pathlib import Path from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string @@ -10,7 +11,10 @@ from django.utils import translation @lru_cache() def logo_data(): """Get logo as MIME Image for emails""" - with open("web/icons/icon_left_brand.png", "rb") as _logo_file: + path = Path("web/icons/icon_left_brand.png") + if not path.exists(): + path = Path("web/dist/assets/icons/icon_left_brand.png") + with open(path, "rb") as _logo_file: logo = MIMEImage(_logo_file.read()) logo.add_header("Content-ID", "logo.png") return logo