mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
feat: add application title
This commit is contained in:
@ -7,6 +7,7 @@ from flask import render_template
|
||||
|
||||
from configs import dify_config
|
||||
from extensions.ext_mail import mail
|
||||
from services.feature_service import FeatureService
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
@ -28,14 +29,16 @@ def send_reset_password_mail_task(language: str, to: str, code: str):
|
||||
if language == "zh-Hans":
|
||||
template = "reset_password_mail_template_zh-CN.html"
|
||||
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)
|
||||
html_content = render_template(template, to=to, code=code, application_title=application_title)
|
||||
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)
|
||||
html_content = render_template(template, to=to, code=code, application_title=application_title)
|
||||
mail.send(to=to, subject="Set Your Dify Password", html=html_content)
|
||||
|
||||
end_at = time.perf_counter()
|
||||
|
||||
Reference in New Issue
Block a user