diff --git a/apiserver/plane/bgtasks/email_verification_task.py b/apiserver/plane/bgtasks/email_verification_task.py index ee4680e53..1da3a7510 100644 --- a/apiserver/plane/bgtasks/email_verification_task.py +++ b/apiserver/plane/bgtasks/email_verification_task.py @@ -2,6 +2,7 @@ from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string from django.utils.html import strip_tags +from django.conf import settings # Third party imports from celery import shared_task @@ -20,7 +21,7 @@ def email_verification(first_name, email, token, current_site): realtivelink = "/request-email-verification/" + "?token=" + str(token) abs_url = "http://" + current_site + realtivelink - from_email_string = f"Team Plane " + from_email_string = settings.EMAIL_FROM subject = f"Verify your Email!" diff --git a/apiserver/plane/bgtasks/forgot_password_task.py b/apiserver/plane/bgtasks/forgot_password_task.py index 4598e5f2f..f13f1b89a 100644 --- a/apiserver/plane/bgtasks/forgot_password_task.py +++ b/apiserver/plane/bgtasks/forgot_password_task.py @@ -2,6 +2,7 @@ from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string from django.utils.html import strip_tags +from django.conf import settings # Third party imports from celery import shared_task @@ -18,7 +19,7 @@ def forgot_password(first_name, email, uidb64, token, current_site): realtivelink = f"/email-verify/?uidb64={uidb64}&token={token}/" abs_url = "http://" + current_site + realtivelink - from_email_string = f"Team Plane " + from_email_string = settings.EMAIL_FROM subject = f"Verify your Email!" diff --git a/apiserver/plane/bgtasks/magic_link_code_task.py b/apiserver/plane/bgtasks/magic_link_code_task.py index 89554dcca..ea97b0fb8 100644 --- a/apiserver/plane/bgtasks/magic_link_code_task.py +++ b/apiserver/plane/bgtasks/magic_link_code_task.py @@ -2,6 +2,7 @@ from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string from django.utils.html import strip_tags +from django.conf import settings # Third party imports from celery import shared_task @@ -14,7 +15,7 @@ def magic_link(email, key, token, current_site): realtivelink = f"/magic-sign-in/?password={token}&key={key}" abs_url = "http://" + current_site + realtivelink - from_email_string = f"Team Plane " + from_email_string = settings.EMAIL_FROM subject = f"Login for Plane" diff --git a/apiserver/plane/bgtasks/project_invitation_task.py b/apiserver/plane/bgtasks/project_invitation_task.py index 18e539970..1c3597120 100644 --- a/apiserver/plane/bgtasks/project_invitation_task.py +++ b/apiserver/plane/bgtasks/project_invitation_task.py @@ -2,6 +2,7 @@ from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string from django.utils.html import strip_tags +from django.conf import settings # Third party imports from celery import shared_task @@ -22,7 +23,7 @@ def project_invitation(email, project_id, token, current_site): relativelink = f"/project-member-invitation/{project_member_invite.id}" abs_url = "http://" + current_site + relativelink - from_email_string = f"Team Plane " + from_email_string = settings.EMAIL_FROM subject = f"{project.created_by.first_name or project.created_by.email} invited you to join {project.name} on Plane" diff --git a/apiserver/plane/bgtasks/workspace_invitation_task.py b/apiserver/plane/bgtasks/workspace_invitation_task.py index c6e69689b..0ce32eee0 100644 --- a/apiserver/plane/bgtasks/workspace_invitation_task.py +++ b/apiserver/plane/bgtasks/workspace_invitation_task.py @@ -27,7 +27,7 @@ def workspace_invitation(email, workspace_id, token, current_site, invitor): ) abs_url = "http://" + current_site + realtivelink - from_email_string = f"Team Plane " + from_email_string = settings.EMAIL_FROM subject = f"{invitor or email} invited you to join {workspace.name} on Plane" diff --git a/apiserver/plane/db/models/user.py b/apiserver/plane/db/models/user.py index 334ec3e13..5a4f487c1 100644 --- a/apiserver/plane/db/models/user.py +++ b/apiserver/plane/db/models/user.py @@ -109,7 +109,7 @@ def send_welcome_email(sender, instance, created, **kwargs): if created and not instance.is_bot: first_name = instance.first_name.capitalize() to_email = instance.email - from_email_string = f"Team Plane " + from_email_string = settings.EMAIL_FROM subject = f"Welcome to Plane ✈️!" diff --git a/apiserver/plane/settings/common.py b/apiserver/plane/settings/common.py index b3a6883bd..f5bff248b 100644 --- a/apiserver/plane/settings/common.py +++ b/apiserver/plane/settings/common.py @@ -179,6 +179,7 @@ EMAIL_PORT = int(os.environ.get("EMAIL_PORT", 587)) EMAIL_HOST_USER = os.environ.get("EMAIL_HOST_USER") EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_HOST_PASSWORD") EMAIL_USE_TLS = os.environ.get("EMAIL_USE_TLS", "1") == "1" +EMAIL_FROM = os.environ.get("EMAIL_FROM", "Team Plane ") SIMPLE_JWT = {