From 05aca9663977237c2fff03e8b3ed74e51f73bd7f Mon Sep 17 00:00:00 2001 From: YuehuCao Date: Mon, 8 Sep 2025 17:10:01 +0800 Subject: [PATCH] feat(template): add the new job notification template --- .../create_global_templates.py | 93 ++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/apps/notification/tests/integration_tests/create_global_templates.py b/apps/notification/tests/integration_tests/create_global_templates.py index c71e73b..3501cd7 100644 --- a/apps/notification/tests/integration_tests/create_global_templates.py +++ b/apps/notification/tests/integration_tests/create_global_templates.py @@ -995,6 +995,93 @@ class GlobalTemplateCreator: return success_cn and success_en + async def create_job_opportunity_template(self): + """create job opportunity notification template""" + print("\n📝 create job opportunity notification template...") + print("🔗 Deep link format: {{job_deep_link_url}}") + # TODO: the deep link should be modified and updated + print(" Example: https://freeleaps-alpha.com/jobs/{{job_id}}?source=email&user={{user_id}}&token={{auth_token}}") + print(" This will redirect to login if needed, then to the specific job posting") + + # Chinese version (region: 1) + template_data_cn = { + "template_id": "job_opportunity_notification", + "region": 1, + "subject": "新的工作机会 - {{candidate_name}}", + "body": """
+
+

freeleaps

+
+ +
+

新的工作机会

+ +

亲爱的 {{candidate_name}}

+ +

在 {{company_domain}} 上有一个新的职位发布,可能符合您的个人资料。点击此链接或登录 {{company_domain}} 查看详情。

+ +
+ + 查看工作机会 + +
+ +
+

祝好!
Freeleaps 团队

+
+ +
+

freeleaps

+

+ We make software development the easiest ever. +

+
+
""" + } + + # English version (region: 0) + template_data_en = { + "template_id": "job_opportunity_notification", + "region": 0, + "subject": "New Job Opportunity - {{candidate_name}}", + "body": """
+
+

freeleaps

+
+ +
+

New Job Opportunity Available

+ +

Dear {{candidate_name}},

+ +

There is a new job posting on {{company_domain}}. It could be something matching your profile. Click this link or log in to {{company_domain}} to check it out.

+ +
+ + View Job Opportunities + +
+ +
+

Best regards,
Freeleaps Team

+
+ +
+

freeleaps

+

+ We make software development the easiest ever. +

+
+
""" + } + + success_cn = await self.create_template(template_data_cn) + success_en = await self.create_template(template_data_en) + + return success_cn and success_en + async def create_all_templates(self): """create all templates""" print("🚀 start creating global templates...") @@ -1010,7 +1097,8 @@ class GlobalTemplateCreator: self.create_interview_status_update_template, self.create_welcome_email_template, self.create_password_reset_template, - self.create_account_verification_template + self.create_account_verification_template, + self.create_job_opportunity_template ] success_count = 0 @@ -1028,7 +1116,8 @@ class GlobalTemplateCreator: "interview_status_update - 面试状态更新", "welcome_email - 欢迎邮件", "password_reset_email - 密码重置邮件", - "account_verification_email - 账号验证邮件" + "account_verification_email - 账号验证邮件", + "job_opportunity_notification - 工作机会通知" ] for i, name in enumerate(template_names, 1):