diff --git a/api/tasks/mail_email_code_login.py b/api/tasks/mail_email_code_login.py index e5d433b7e4..4bfaaca453 100644 --- a/api/tasks/mail_email_code_login.py +++ b/api/tasks/mail_email_code_login.py @@ -31,14 +31,18 @@ def send_email_code_login_mail_task(language: str, to: str, code: str): if dify_config.ENTERPRISE_ENABLED: application_title = FeatureService.get_system_features().get("application_title", "Dify") template = "without-brand/email_code_login_mail_template_zh-CN_enterprise.html" - html_content = render_template(template, to=to, code=code, application_title=application_title) + html_content = render_template(template, to=to, code=code, application_title=application_title) + else: + html_content = render_template(template, to=to, code=code) mail.send(to=to, subject="邮箱验证码", html=html_content) else: template = "email_code_login_mail_template_en-US.html" if dify_config.ENTERPRISE_ENABLED: application_title = FeatureService.get_system_features().get("application_title", "Dify") template = "without-brand/email_code_login_mail_template_en-US_enterprise.html" - html_content = render_template(template, to=to, code=code, application_title=application_title) + html_content = render_template(template, to=to, code=code, application_title=application_title) + else: + html_content = render_template(template, to=to, code=code) mail.send(to=to, subject="Email Code", html=html_content) end_at = time.perf_counter() diff --git a/api/tasks/mail_invite_member_task.py b/api/tasks/mail_invite_member_task.py index 33ec128f2f..92c8250586 100644 --- a/api/tasks/mail_invite_member_task.py +++ b/api/tasks/mail_invite_member_task.py @@ -38,28 +38,36 @@ def send_invite_member_mail_task(language: str, to: str, token: str, inviter_nam if dify_config.ENTERPRISE_ENABLED: application_title = FeatureService.get_system_features().get("application_title", "Dify") template = "without-brand/invite_member_mail_template_zh-CN.html" - html_content = render_template( - template, - to=to, - inviter_name=inviter_name, - workspace_name=workspace_name, - url=url, - application_title=application_title, - ) + html_content = render_template( + template, + to=to, + inviter_name=inviter_name, + workspace_name=workspace_name, + url=url, + application_title=application_title, + ) + else: + html_content = render_template( + template, to=to, inviter_name=inviter_name, workspace_name=workspace_name, url=url + ) mail.send(to=to, subject="立即加入 Dify 工作空间", html=html_content) else: template = "invite_member_mail_template_en-US.html" if dify_config.ENTERPRISE_ENABLED: application_title = FeatureService.get_system_features().get("application_title", "Dify") template = "without-brand/invite_member_mail_template_en-US.html" - html_content = render_template( - template, - to=to, - inviter_name=inviter_name, - workspace_name=workspace_name, - url=url, - application_title=application_title, - ) + html_content = render_template( + template, + to=to, + inviter_name=inviter_name, + workspace_name=workspace_name, + url=url, + application_title=application_title, + ) + else: + html_content = render_template( + template, to=to, inviter_name=inviter_name, workspace_name=workspace_name, url=url + ) mail.send(to=to, subject="Join Dify Workspace Now", html=html_content) end_at = time.perf_counter() diff --git a/api/tasks/mail_reset_password_task.py b/api/tasks/mail_reset_password_task.py index 1c260209d6..d892dbe345 100644 --- a/api/tasks/mail_reset_password_task.py +++ b/api/tasks/mail_reset_password_task.py @@ -31,14 +31,18 @@ def send_reset_password_mail_task(language: str, to: str, code: str): if dify_config.ENTERPRISE_ENABLED: application_title = FeatureService.get_system_features().get("application_title", "Dify") template = "without-brand/reset_password_mail_template_zh-CN.html" - html_content = render_template(template, to=to, code=code, application_title=application_title) + html_content = render_template(template, to=to, code=code, application_title=application_title) + else: + html_content = render_template(template, to=to, code=code) mail.send(to=to, subject="设置您的 Dify 密码", html=html_content) else: template = "reset_password_mail_template_en-US.html" if dify_config.ENTERPRISE_ENABLED: application_title = FeatureService.get_system_features().get("application_title", "Dify") template = "without-brand/reset_password_mail_template_en-US.html" - html_content = render_template(template, to=to, code=code, application_title=application_title) + html_content = render_template(template, to=to, code=code, application_title=application_title) + else: + html_content = render_template(template, to=to, code=code) mail.send(to=to, subject="Set Your Dify Password", html=html_content) end_at = time.perf_counter()