feat(template): add the new job notification template
This commit is contained in:
parent
046f9ffdd2
commit
05aca96639
@ -995,6 +995,93 @@ class GlobalTemplateCreator:
|
|||||||
|
|
||||||
return success_cn and success_en
|
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": """<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;">
|
||||||
|
<div style="background-color: #1748f8; color: white; padding: 20px; text-align: center; margin-bottom: 20px;">
|
||||||
|
<h1 style="margin: 0;">freeleaps</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="padding: 20px;">
|
||||||
|
<h2>新的工作机会</h2>
|
||||||
|
|
||||||
|
<p>亲爱的 <strong>{{candidate_name}}</strong>,</p>
|
||||||
|
|
||||||
|
<p>在 {{company_domain}} 上有一个新的职位发布,可能符合您的个人资料。点击此链接或登录 {{company_domain}} 查看详情。</p>
|
||||||
|
|
||||||
|
<div style="text-align: center; margin: 30px 0;">
|
||||||
|
<a href="{{job_deep_link_url}}"
|
||||||
|
style="background-color: #1748f8; color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px; display: inline-block;">
|
||||||
|
查看工作机会
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<p>祝好!<br>Freeleaps 团队</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="background-color: #f8f9fa; padding: 20px; text-align: center; margin-top: 20px;">
|
||||||
|
<p style="margin: 0; font-weight: bold;">freeleaps</p>
|
||||||
|
<p style="margin: 5px 0 0 0; font-style: italic; color: #666;">
|
||||||
|
We make software development the easiest ever.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>"""
|
||||||
|
}
|
||||||
|
|
||||||
|
# English version (region: 0)
|
||||||
|
template_data_en = {
|
||||||
|
"template_id": "job_opportunity_notification",
|
||||||
|
"region": 0,
|
||||||
|
"subject": "New Job Opportunity - {{candidate_name}}",
|
||||||
|
"body": """<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px;">
|
||||||
|
<div style="background-color: #1748f8; color: white; padding: 20px; text-align: center; margin-bottom: 20px;">
|
||||||
|
<h1 style="margin: 0;">freeleaps</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="padding: 20px;">
|
||||||
|
<h2>New Job Opportunity Available</h2>
|
||||||
|
|
||||||
|
<p>Dear <strong>{{candidate_name}}</strong>,</p>
|
||||||
|
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
<div style="text-align: center; margin: 30px 0;">
|
||||||
|
<a href="{{job_deep_link_url}}"
|
||||||
|
style="background-color: #1748f8; color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px; display: inline-block;">
|
||||||
|
View Job Opportunities
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<p>Best regards,<br>Freeleaps Team</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="background-color: #f8f9fa; padding: 20px; text-align: center; margin-top: 20px;">
|
||||||
|
<p style="margin: 0; font-weight: bold;">freeleaps</p>
|
||||||
|
<p style="margin: 5px 0 0 0; font-style: italic; color: #666;">
|
||||||
|
We make software development the easiest ever.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>"""
|
||||||
|
}
|
||||||
|
|
||||||
|
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):
|
async def create_all_templates(self):
|
||||||
"""create all templates"""
|
"""create all templates"""
|
||||||
print("🚀 start creating global templates...")
|
print("🚀 start creating global templates...")
|
||||||
@ -1010,7 +1097,8 @@ class GlobalTemplateCreator:
|
|||||||
self.create_interview_status_update_template,
|
self.create_interview_status_update_template,
|
||||||
self.create_welcome_email_template,
|
self.create_welcome_email_template,
|
||||||
self.create_password_reset_template,
|
self.create_password_reset_template,
|
||||||
self.create_account_verification_template
|
self.create_account_verification_template,
|
||||||
|
self.create_job_opportunity_template
|
||||||
]
|
]
|
||||||
|
|
||||||
success_count = 0
|
success_count = 0
|
||||||
@ -1028,7 +1116,8 @@ class GlobalTemplateCreator:
|
|||||||
"interview_status_update - 面试状态更新",
|
"interview_status_update - 面试状态更新",
|
||||||
"welcome_email - 欢迎邮件",
|
"welcome_email - 欢迎邮件",
|
||||||
"password_reset_email - 密码重置邮件",
|
"password_reset_email - 密码重置邮件",
|
||||||
"account_verification_email - 账号验证邮件"
|
"account_verification_email - 账号验证邮件",
|
||||||
|
"job_opportunity_notification - 工作机会通知"
|
||||||
]
|
]
|
||||||
|
|
||||||
for i, name in enumerate(template_names, 1):
|
for i, name in enumerate(template_names, 1):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user