Merge branch 'e-0154' into deploy/enterprise

This commit is contained in:
GareArc 2025-03-17 14:24:00 -04:00
commit ea769c6483
3 changed files with 36 additions and 20 deletions

View File

@ -32,6 +32,8 @@ def send_email_code_login_mail_task(language: str, to: str, code: str):
application_title = FeatureService.get_system_features().get("application_title", "Dify") application_title = FeatureService.get_system_features().get("application_title", "Dify")
template = "without-brand/email_code_login_mail_template_zh-CN_enterprise.html" 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) mail.send(to=to, subject="邮箱验证码", html=html_content)
else: else:
template = "email_code_login_mail_template_en-US.html" template = "email_code_login_mail_template_en-US.html"
@ -39,6 +41,8 @@ def send_email_code_login_mail_task(language: str, to: str, code: str):
application_title = FeatureService.get_system_features().get("application_title", "Dify") application_title = FeatureService.get_system_features().get("application_title", "Dify")
template = "without-brand/email_code_login_mail_template_en-US_enterprise.html" 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) mail.send(to=to, subject="Email Code", html=html_content)
end_at = time.perf_counter() end_at = time.perf_counter()

View File

@ -46,6 +46,10 @@ def send_invite_member_mail_task(language: str, to: str, token: str, inviter_nam
url=url, url=url,
application_title=application_title, 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) mail.send(to=to, subject="立即加入 Dify 工作空间", html=html_content)
else: else:
template = "invite_member_mail_template_en-US.html" template = "invite_member_mail_template_en-US.html"
@ -60,6 +64,10 @@ def send_invite_member_mail_task(language: str, to: str, token: str, inviter_nam
url=url, url=url,
application_title=application_title, 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) mail.send(to=to, subject="Join Dify Workspace Now", html=html_content)
end_at = time.perf_counter() end_at = time.perf_counter()

View File

@ -32,6 +32,8 @@ def send_reset_password_mail_task(language: str, to: str, code: str):
application_title = FeatureService.get_system_features().get("application_title", "Dify") application_title = FeatureService.get_system_features().get("application_title", "Dify")
template = "without-brand/reset_password_mail_template_zh-CN.html" 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) mail.send(to=to, subject="设置您的 Dify 密码", html=html_content)
else: else:
template = "reset_password_mail_template_en-US.html" template = "reset_password_mail_template_en-US.html"
@ -39,6 +41,8 @@ def send_reset_password_mail_task(language: str, to: str, code: str):
application_title = FeatureService.get_system_features().get("application_title", "Dify") application_title = FeatureService.get_system_features().get("application_title", "Dify")
template = "without-brand/reset_password_mail_template_en-US.html" 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) mail.send(to=to, subject="Set Your Dify Password", html=html_content)
end_at = time.perf_counter() end_at = time.perf_counter()