Skip to content

Commit fe16f9b

Browse files
feat: Add EMAIL_FRONTEND_DOMAIN override to Djoser (#8329)
Signed-off-by: germangarces <german.garces@flagsmith.com> Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
1 parent 34b9e67 commit fe16f9b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

api/app/settings/common.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,12 @@
917917
"SECRET_KEY_LENGTH": 32,
918918
}
919919

920+
# Controls the app domain used in emails (currently invites and change requests).
921+
# If set, domain stored with `django.contrib.sites` is disregarded.
922+
DOMAIN_OVERRIDE = env.str("FLAGSMITH_DOMAIN", "")
923+
# Used when no Django site is specified.
924+
DEFAULT_DOMAIN = "app.flagsmith.com"
925+
920926
USER_CREATE_PERMISSIONS = env.list(
921927
"USER_CREATE_PERMISSIONS", default=["custom_auth.permissions.IsSignupAllowed"]
922928
)
@@ -928,6 +934,7 @@
928934
"PASSWORD_RESET_CONFIRM_URL": "password-reset/confirm/{uid}/{token}",
929935
# if True user required to click activation link in email to activate account
930936
"SEND_ACTIVATION_EMAIL": env.bool("ENABLE_EMAIL_ACTIVATION", default=False),
937+
"EMAIL_FRONTEND_DOMAIN": DOMAIN_OVERRIDE,
931938
# FE uri to redirect user to from activation email
932939
"ACTIVATION_URL": "activate/{uid}/{token}",
933940
# register or activation endpoint will send confirmation email to user
@@ -1294,12 +1301,6 @@
12941301
# Used for serializing and deserializing GenericForeignKey(used in metadata) using the natural key of the object
12951302
SERIALIZATION_MODULES = {"json": "import_export.json_serializers_with_metadata_support"}
12961303

1297-
# Controls the app domain used in emails (currently invites and change requests).
1298-
# If set, domain stored with `django.contrib.sites` is disregarded.
1299-
DOMAIN_OVERRIDE = env.str("FLAGSMITH_DOMAIN", "")
1300-
# Used when no Django site is specified.
1301-
DEFAULT_DOMAIN = "app.flagsmith.com"
1302-
13031304
# Define the cooldown duration, in seconds, for password reset emails
13041305
PASSWORD_RESET_EMAIL_COOLDOWN = env.int("PASSWORD_RESET_EMAIL_COOLDOWN", 60 * 60 * 24)
13051306
# Define the threshold, in minutes, for updating the last login timestamp

0 commit comments

Comments
 (0)