feat: add trigger events limit email template

This commit is contained in:
lyzno1
2025-11-12 12:42:22 +08:00
parent b76e17b25d
commit 7c5a008f5c
5 changed files with 554 additions and 0 deletions

View File

@@ -38,6 +38,8 @@ class EmailType(StrEnum):
EMAIL_REGISTER = auto()
EMAIL_REGISTER_WHEN_ACCOUNT_EXIST = auto()
RESET_PASSWORD_WHEN_ACCOUNT_NOT_EXIST_NO_REGISTER = auto()
TRIGGER_EVENTS_LIMIT_SANDBOX = auto()
TRIGGER_EVENTS_LIMIT_PROFESSIONAL = auto()
class EmailLanguage(StrEnum):
@@ -445,6 +447,30 @@ def create_default_email_config() -> EmailI18nConfig:
branded_template_path="clean_document_job_mail_template_zh-CN.html",
),
},
EmailType.TRIGGER_EVENTS_LIMIT_SANDBOX: {
EmailLanguage.EN_US: EmailTemplate(
subject="Youve reached your Sandbox Trigger Events limit",
template_path="trigger_events_limit_template_en-US.html",
branded_template_path="without-brand/trigger_events_limit_template_en-US.html",
),
EmailLanguage.ZH_HANS: EmailTemplate(
subject="您的 Sandbox 触发事件额度已用尽",
template_path="trigger_events_limit_template_zh-CN.html",
branded_template_path="without-brand/trigger_events_limit_template_zh-CN.html",
),
},
EmailType.TRIGGER_EVENTS_LIMIT_PROFESSIONAL: {
EmailLanguage.EN_US: EmailTemplate(
subject="Youve reached your monthly Trigger Events limit",
template_path="trigger_events_limit_template_en-US.html",
branded_template_path="without-brand/trigger_events_limit_template_en-US.html",
),
EmailLanguage.ZH_HANS: EmailTemplate(
subject="您的月度触发事件额度已用尽",
template_path="trigger_events_limit_template_zh-CN.html",
branded_template_path="without-brand/trigger_events_limit_template_zh-CN.html",
),
},
EmailType.EMAIL_REGISTER: {
EmailLanguage.EN_US: EmailTemplate(
subject="Register Your {application_title} Account",

View File

@@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: 'Inter', 'Arial', sans-serif;
background-color: #e9ebf0;
margin: 0;
padding: 0;
color: #000000;
}
*, *::before, *::after {
box-sizing: border-box;
}
.card {
width: 600px;
min-height: 454px;
margin: 40px auto;
display: flex;
flex-direction: column;
background: #fcfcfd;
border: 1px solid #ffffff;
box-shadow: 0px 3px 10px -2px rgba(9, 9, 11, 0.08), 0px 2px 4px -2px rgba(9, 9, 11, 0.06);
border-radius: 16px;
}
.card-header {
padding: 36px 48px 24px;
display: flex;
flex-direction: column;
gap: 8px;
}
.card-header img {
width: 68px;
height: auto;
}
.card-content {
display: flex;
flex-direction: column;
gap: 16px;
padding: 8px 48px 48px;
width: 100%;
}
.title {
margin: 0;
font-size: 24px;
font-weight: 600;
line-height: 120%;
color: #000000;
}
.body-group {
display: flex;
flex-direction: column;
gap: 12px;
padding: 16px 0;
}
.body-text {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
.body-text strong {
font-weight: 600;
color: #101828;
}
.cta {
display: inline-flex;
justify-content: center;
align-items: center;
width: 100%;
max-width: 504px;
height: 32px;
padding: 0 16px;
gap: 8px;
background: #1677ff;
border-radius: 6px;
text-decoration: none;
color: #ffffff !important;
font-size: 14px;
line-height: 22px;
font-weight: 400;
}
.note {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
</style>
</head>
<body>
<div class="card">
<div class="card-header">
<img src="https://assets.dify.ai/images/logo.png" alt="Dify Logo" />
</div>
<div class="card-content">
<h1 class="title">Youve reached your trigger events limit</h1>
<div class="body-group">
<p class="body-text">
Your workspace <strong>{{workspaceName}}</strong> has used all available <strong>Trigger Events</strong> for the
<strong>{{planName}} Plan (limit: {{planLimit}})</strong>.
</p>
<p class="body-text">
Workflows triggered by <strong>{{triggerSources}}</strong> events have been temporarily paused.
</p>
<p class="body-text">
To keep your workflows running without interruption, please upgrade your plan to unlock more Trigger Events.
</p>
</div>
<a class="cta" href="{{upgradeUrl}}" target="_blank" rel="noopener noreferrer">{{ctaLabel}}</a>
<p class="note">
<strong>Trigger Events</strong> for the <strong>{{planName}} Plan</strong> <strong>{{resetDescription}}</strong>.
</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<style>
body {
font-family: 'Inter', 'PingFang SC', 'Arial', sans-serif;
background-color: #e9ebf0;
margin: 0;
padding: 0;
color: #000000;
}
*, *::before, *::after {
box-sizing: border-box;
}
.card {
width: 600px;
min-height: 454px;
margin: 40px auto;
display: flex;
flex-direction: column;
background: #fcfcfd;
border: 1px solid #ffffff;
box-shadow: 0px 3px 10px -2px rgba(9, 9, 11, 0.08), 0px 2px 4px -2px rgba(9, 9, 11, 0.06);
border-radius: 16px;
}
.card-header {
padding: 36px 48px 24px;
display: flex;
flex-direction: column;
gap: 8px;
}
.card-header img {
width: 68px;
height: auto;
}
.card-content {
display: flex;
flex-direction: column;
gap: 16px;
padding: 8px 48px 48px;
width: 100%;
}
.title {
margin: 0;
font-size: 24px;
font-weight: 600;
line-height: 120%;
color: #000000;
}
.body-group {
display: flex;
flex-direction: column;
gap: 12px;
padding: 16px 0;
}
.body-text {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
.body-text strong {
font-weight: 600;
color: #101828;
}
.cta {
display: inline-flex;
justify-content: center;
align-items: center;
width: 100%;
max-width: 504px;
height: 32px;
padding: 0 16px;
gap: 8px;
background: #1677ff;
border-radius: 6px;
text-decoration: none;
color: #ffffff !important;
font-size: 14px;
line-height: 22px;
font-weight: 400;
}
.note {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
</style>
</head>
<body>
<div class="card">
<div class="card-header">
<img src="https://assets.dify.ai/images/logo.png" alt="Dify Logo" />
</div>
<div class="card-content">
<h1 class="title">您的触发事件额度已用尽</h1>
<div class="body-group">
<p class="body-text">
您的工作区 <strong>{{workspaceName}}</strong> 已用完 <strong>Trigger Events</strong>,并耗尽
<strong>{{planName}} 计划(上限:{{planLimit}}</strong> 的全部额度。
</p>
<p class="body-text">
<strong>{{triggerSources}}</strong> 触发的工作流已被暂时暂停。
</p>
<p class="body-text">
为保证工作流不中断,请升级套餐以解锁更多触发事件额度。
</p>
</div>
<a class="cta" href="{{upgradeUrl}}" target="_blank" rel="noopener noreferrer">{{ctaLabel}}</a>
<p class="note">
<strong>{{planName}} 计划的触发事件额度{{resetDescription}}</strong>
</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,131 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: 'Inter', 'Arial', sans-serif;
background-color: #e9ebf0;
margin: 0;
padding: 0;
color: #000000;
}
*, *::before, *::after {
box-sizing: border-box;
}
.card {
width: 600px;
min-height: 454px;
margin: 40px auto;
display: flex;
flex-direction: column;
background: #fcfcfd;
border: 1px solid #ffffff;
box-shadow: 0px 3px 10px -2px rgba(9, 9, 11, 0.08), 0px 2px 4px -2px rgba(9, 9, 11, 0.06);
border-radius: 16px;
}
.card-header {
padding: 36px 48px 24px;
display: flex;
flex-direction: column;
gap: 8px;
}
.card-header img {
width: 68px;
height: auto;
}
.card-content {
display: flex;
flex-direction: column;
gap: 16px;
padding: 8px 48px 48px;
width: 100%;
}
.title {
margin: 0;
font-size: 24px;
font-weight: 600;
line-height: 120%;
color: #000000;
}
.body-group {
display: flex;
flex-direction: column;
gap: 12px;
padding: 16px 0;
}
.body-text {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
.body-text strong {
font-weight: 600;
color: #101828;
}
.cta {
display: inline-flex;
justify-content: center;
align-items: center;
width: 100%;
max-width: 504px;
height: 32px;
padding: 0 16px;
gap: 8px;
background: #1677ff;
border-radius: 6px;
text-decoration: none;
color: #ffffff !important;
font-size: 14px;
line-height: 22px;
font-weight: 400;
}
.note {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
</style>
</head>
<body>
<div class="card">
<div class="card-header"></div>
<div class="card-content">
<h1 class="title">Youve reached your trigger events limit</h1>
<div class="body-group">
<p class="body-text">
Your workspace <strong>{{workspaceName}}</strong> has used all available <strong>Trigger Events</strong> for the
<strong>{{planName}} Plan (limit: {{planLimit}})</strong>.
</p>
<p class="body-text">
Workflows triggered by <strong>{{triggerSources}}</strong> events have been temporarily paused.
</p>
<p class="body-text">
To keep your workflows running without interruption, please upgrade your plan to unlock more Trigger Events.
</p>
</div>
<a class="cta" href="{{upgradeUrl}}" target="_blank" rel="noopener noreferrer">{{ctaLabel}}</a>
<p class="note">
<strong>Trigger Events</strong> for the <strong>{{planName}} Plan</strong> <strong>{{resetDescription}}</strong>.
</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,131 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<style>
body {
font-family: 'Inter', 'PingFang SC', 'Arial', sans-serif;
background-color: #e9ebf0;
margin: 0;
padding: 0;
color: #000000;
}
*, *::before, *::after {
box-sizing: border-box;
}
.card {
width: 600px;
min-height: 454px;
margin: 40px auto;
display: flex;
flex-direction: column;
background: #fcfcfd;
border: 1px solid #ffffff;
box-shadow: 0px 3px 10px -2px rgba(9, 9, 11, 0.08), 0px 2px 4px -2px rgba(9, 9, 11, 0.06);
border-radius: 16px;
}
.card-header {
padding: 36px 48px 24px;
display: flex;
flex-direction: column;
gap: 8px;
}
.card-header img {
width: 68px;
height: auto;
}
.card-content {
display: flex;
flex-direction: column;
gap: 16px;
padding: 8px 48px 48px;
width: 100%;
}
.title {
margin: 0;
font-size: 24px;
font-weight: 600;
line-height: 120%;
color: #000000;
}
.body-group {
display: flex;
flex-direction: column;
gap: 12px;
padding: 16px 0;
}
.body-text {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
.body-text strong {
font-weight: 600;
color: #101828;
}
.cta {
display: inline-flex;
justify-content: center;
align-items: center;
width: 100%;
max-width: 504px;
height: 32px;
padding: 0 16px;
gap: 8px;
background: #1677ff;
border-radius: 6px;
text-decoration: none;
color: #ffffff !important;
font-size: 14px;
line-height: 22px;
font-weight: 400;
}
.note {
margin: 0;
font-size: 14px;
line-height: 20px;
letter-spacing: -0.005em;
color: #354052;
}
</style>
</head>
<body>
<div class="card">
<div class="card-header"></div>
<div class="card-content">
<h1 class="title">您的触发事件额度已用尽</h1>
<div class="body-group">
<p class="body-text">
您的工作区 <strong>{{workspaceName}}</strong> 已用完 <strong>Trigger Events</strong>,并耗尽
<strong>{{planName}} 计划(上限:{{planLimit}}</strong> 的全部额度。
</p>
<p class="body-text">
<strong>{{triggerSources}}</strong> 触发的工作流已被暂时暂停。
</p>
<p class="body-text">
为保证工作流不中断,请升级套餐以解锁更多触发事件额度。
</p>
</div>
<a class="cta" href="{{upgradeUrl}}" target="_blank" rel="noopener noreferrer">{{ctaLabel}}</a>
<p class="note">
<strong>{{planName}} 计划的触发事件额度{{resetDescription}}</strong>
</p>
</div>
</div>
</body>
</html>