diff --git a/app/config.py b/app/config.py index 6f35484d..1755e43d 100644 --- a/app/config.py +++ b/app/config.py @@ -272,3 +272,6 @@ ALERT_SPAM_EMAIL = "spam" ALERT_SPF = "spf" # <<<<< END ALERT EMAIL >>>> + +# Disable onboarding emails +DISABLE_ONBOARDING = "DISABLE_ONBOARDING" in os.environ diff --git a/app/models.py b/app/models.py index fcfe5f49..7ca84bc6 100644 --- a/app/models.py +++ b/app/models.py @@ -24,6 +24,7 @@ from app.config import ( JOB_ONBOARDING_4, LANDING_PAGE_URL, FIRST_ALIAS_DOMAIN, + DISABLE_ONBOARDING, ) from app.errors import AliasInTrashError from app.extensions import db @@ -204,6 +205,10 @@ class User(db.Model, ModelMixin, UserMixin): Alias.create_new(user, prefix="my-first-alias", mailbox_id=mb.id) db.session.flush() + if DISABLE_ONBOARDING: + LOG.d("Disable onboarding emails") + return user + # Schedule onboarding emails Job.create( name=JOB_ONBOARDING_1, diff --git a/example.env b/example.env index 6083f2a2..67823ce5 100644 --- a/example.env +++ b/example.env @@ -129,4 +129,8 @@ FACEBOOK_CLIENT_SECRET=to_fill # Used when querying info on Apple API # APPLE_API_SECRET=secret -# MACAPP_APPLE_API_SECRET=secret \ No newline at end of file +# MACAPP_APPLE_API_SECRET=secret + +# Disable onboarding emails +# For self-hosted instance +DISABLE_ONBOARDING=true \ No newline at end of file