mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-08 06:21:49 +08:00
fix: change subject title
This commit is contained in:
parent
56aaee5558
commit
d38f2cb380
@ -198,8 +198,8 @@ class FeatureService:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_enterprise_application_title(cls):
|
def get_enterprise_application_title(cls):
|
||||||
branding = cls.get_system_features().get("branding", None)
|
branding = cls.get_system_features().branding
|
||||||
application_title = "Dify"
|
application_title = "Dify"
|
||||||
if branding and branding.get("enabled", False):
|
if branding.enabled:
|
||||||
application_title = branding.get("application_title", "Dify")
|
application_title = branding.application_title
|
||||||
return application_title
|
return application_title
|
||||||
|
@ -46,11 +46,12 @@ 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,
|
||||||
)
|
)
|
||||||
|
mail.send(to=to, subject=f"立即加入 {application_title} 工作空间", html=html_content)
|
||||||
else:
|
else:
|
||||||
html_content = render_template(
|
html_content = render_template(
|
||||||
template, to=to, inviter_name=inviter_name, workspace_name=workspace_name, url=url
|
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"
|
||||||
if dify_config.ENTERPRISE_ENABLED:
|
if dify_config.ENTERPRISE_ENABLED:
|
||||||
@ -64,11 +65,12 @@ 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,
|
||||||
)
|
)
|
||||||
|
mail.send(to=to, subject=f"Join {application_title} Workspace Now", html=html_content)
|
||||||
else:
|
else:
|
||||||
html_content = render_template(
|
html_content = render_template(
|
||||||
template, to=to, inviter_name=inviter_name, workspace_name=workspace_name, url=url
|
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()
|
||||||
logging.info(
|
logging.info(
|
||||||
|
@ -32,18 +32,20 @@ def send_reset_password_mail_task(language: str, to: str, code: str):
|
|||||||
application_title = FeatureService.get_enterprise_application_title()
|
application_title = FeatureService.get_enterprise_application_title()
|
||||||
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)
|
||||||
|
mail.send(to=to, subject=f"设置您的 {application_title} 密码", html=html_content)
|
||||||
else:
|
else:
|
||||||
html_content = render_template(template, to=to, code=code)
|
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"
|
||||||
if dify_config.ENTERPRISE_ENABLED:
|
if dify_config.ENTERPRISE_ENABLED:
|
||||||
application_title = FeatureService.get_enterprise_application_title()
|
application_title = FeatureService.get_enterprise_application_title()
|
||||||
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)
|
||||||
|
mail.send(to=to, subject=f"Set Your {application_title} Password", html=html_content)
|
||||||
else:
|
else:
|
||||||
html_content = render_template(template, to=to, code=code)
|
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()
|
||||||
logging.info(
|
logging.info(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user