diff --git a/api/libs/email_i18n.py b/api/libs/email_i18n.py index 25f771c848..42cf119104 100644 --- a/api/libs/email_i18n.py +++ b/api/libs/email_i18n.py @@ -40,6 +40,8 @@ class EmailType(StrEnum): RESET_PASSWORD_WHEN_ACCOUNT_NOT_EXIST_NO_REGISTER = auto() TRIGGER_EVENTS_LIMIT_SANDBOX = auto() TRIGGER_EVENTS_LIMIT_PROFESSIONAL = auto() + TRIGGER_EVENTS_USAGE_WARNING_SANDBOX = auto() + TRIGGER_EVENTS_USAGE_WARNING_PROFESSIONAL = auto() class EmailLanguage(StrEnum): @@ -471,6 +473,30 @@ def create_default_email_config() -> EmailI18nConfig: branded_template_path="without-brand/trigger_events_limit_template_zh-CN.html", ), }, + EmailType.TRIGGER_EVENTS_USAGE_WARNING_SANDBOX: { + EmailLanguage.EN_US: EmailTemplate( + subject="You’re nearing your Sandbox Trigger Events limit", + template_path="trigger_events_usage_warning_template_en-US.html", + branded_template_path="without-brand/trigger_events_usage_warning_template_en-US.html", + ), + EmailLanguage.ZH_HANS: EmailTemplate( + subject="您的 Sandbox 触发事件额度接近上限", + template_path="trigger_events_usage_warning_template_zh-CN.html", + branded_template_path="without-brand/trigger_events_usage_warning_template_zh-CN.html", + ), + }, + EmailType.TRIGGER_EVENTS_USAGE_WARNING_PROFESSIONAL: { + EmailLanguage.EN_US: EmailTemplate( + subject="You’re nearing your Monthly Trigger Events limit", + template_path="trigger_events_usage_warning_template_en-US.html", + branded_template_path="without-brand/trigger_events_usage_warning_template_en-US.html", + ), + EmailLanguage.ZH_HANS: EmailTemplate( + subject="您的月度触发事件额度接近上限", + template_path="trigger_events_usage_warning_template_zh-CN.html", + branded_template_path="without-brand/trigger_events_usage_warning_template_zh-CN.html", + ), + }, EmailType.EMAIL_REGISTER: { EmailLanguage.EN_US: EmailTemplate( subject="Register Your {application_title} Account", diff --git a/api/templates/trigger_events_usage_warning_template_en-US.html b/api/templates/trigger_events_usage_warning_template_en-US.html new file mode 100644 index 0000000000..86517551fb --- /dev/null +++ b/api/templates/trigger_events_usage_warning_template_en-US.html @@ -0,0 +1,134 @@ + + + +
+ + + + +
+ + Your workspace {{workspaceName}} has used {{usagePercent}} of its + {{usageScope}} for the {{planName}} Plan (limit: {{planLimit}}). +
++ Once the limit is reached, workflows triggered by {{triggerSources}} events will be temporarily + paused. +
++ {{upgradeHint}} +
++ Trigger Events for the {{planName}} Plan {{resetDescription}}. +
+
+ + 您的工作区 {{workspaceName}} 已使用 {{usagePercent}} 的 + {{usageScope}},触及 {{planName}} 计划(上限:{{planLimit}})。 +
++ 一旦达到上限,由 {{triggerSources}} 触发的工作流将被暂时暂停。 +
++ {{upgradeHint}} +
++ {{planName}} 计划的触发事件额度{{resetDescription}}。 +
++ Your workspace {{workspaceName}} has used {{usagePercent}} of its + {{usageScope}} for the {{planName}} Plan (limit: {{planLimit}}). +
++ Once the limit is reached, workflows triggered by {{triggerSources}} events will be temporarily + paused. +
++ {{upgradeHint}} +
++ Trigger Events for the {{planName}} Plan {{resetDescription}}. +
++ 您的工作区 {{workspaceName}} 已使用 {{usagePercent}} 的 + {{usageScope}},触及 {{planName}} 计划(上限:{{planLimit}})。 +
++ 一旦达到上限,由 {{triggerSources}} 触发的工作流将被暂时暂停。 +
++ {{upgradeHint}} +
++ {{planName}} 计划的触发事件额度{{resetDescription}}。 +
+