# @Author : Rocky # @File : ActivityService.py # @Time : 2025/11/19 16:16 import time import pytz from datetime import datetime class ActivityObj: """ 临时活动类 """ @staticmethod def is_in_discount_period(now_time=None): """ 判断是否在优惠活动期间(东部时间 11.26-12.26) @param now_time: 当前时间戳(可选,默认为当前时间) @return: True 表示在活动期间,False 表示不在 """ if now_time is None: now_time = int(time.time()) # 转换为东部时间(ET) eastern = pytz.timezone('America/New_York') current_dt = datetime.fromtimestamp(now_time, tz=eastern) # 活动开始时间:2025-11-26 00:00:00 ET start_dt = eastern.localize(datetime(2025, 11, 26, 0, 0, 0)) # 活动结束时间:2025-12-26 23:59:59 ET end_dt = eastern.localize(datetime(2025, 12, 26, 23, 59, 59)) return start_dt <= current_dt <= end_dt @staticmethod def get_discount_email_content(device_name, end_date, days_remaining): """ 获取优惠活动期间的邮件内容 @param device_name: 设备名称 @param end_date: 到期日期 @param days_remaining: 剩余天数(7 或 3) @return: {‘subject': 邮件主题, 'html_body': HTML正文} """ # 根据剩余天数设定不同的紧迫性文案 if days_remaining == 7: urgency_text = "Your cloud storage plan is expiring soon." else: # 3 天 urgency_text = "Your plan expires in just 3 days - Act now!" subject = f"Reminder: Cloud Storage Plan Expiring Soon for {device_name}" html_body = f"""

🔔 Cloud Storage Plan Expiration Reminder

Dear Customer,

⚠️ {urgency_text}
Your cloud storage package for device {device_name} will expire on {end_date}. If not renewed in time, your cloud storage service will be unavailable.

To avoid data service interruption, we have prepared exclusive discounts on long-term plans for you — much more cost-effective than monthly plans!

🎁 Plan Comparison - Choose What Fits Your Needs:

Plan Name 1-Year Plan 2-Year Plan 3-Year Plan 5-Year Plan
Zosi Cloud standard Plan $47.88 $39.99
Save $7.89
$95.76 $69.99
Save $25.77
$143.64 $103.99
Save $39.65
$239.4 $169.99
Save $69.41
Zosi Cloud standard + Al Plan $71.88 $59.99
Save $11.89
$143.76 $106.99
Save $36.77
$215.64 $149.99
Save $65.65
$359.4 $229.99
Save $129.41
Zosi Cloud Premium Plan $107.88 $89.99
Save $17.89
$215.76 $139.99
Save $75.77
$323.64 $203.99
Save $119.65
$539.4 $335.99
Save $203.41
Zosi Cloud Premium + Al Plan $131.88 $109.99
Save $21.89
$263.76 $199.99
Save $63.77
$395.64 $249.99
Save $145.65
$659.4 $389.99
Save $269.41

🚀 How to Renew Quickly?

  1. Log in to your Zosi App
  2. Click on the Cloud Storage icon
  3. Select "Cloud Storage Plan"
  4. Choose your preferred plan and complete the payment

📞 Need Help?

If you encounter any issues during the renewal process, feel free to contact our 24/7 Customer Service:

📧 Support Email: support@zosisecurity.com

👥 Facebook: https://www.facebook.com/ZosiTechnology/

🎫 Support Center: support@zositechhelp.zendesk.com

✨ Important Notes:

  • If you have already renewed, you can ignore this email. Your plan validity will be automatically extended.
  • This discount is a limited-time offer. Prices will return to normal after the promotion period, so act now!

Thank you for trusting Zosi Cloud Storage Service. We will continue to provide you with secure, stable, and convenient file storage experience, keeping your data safe and uninterrupted!

Best regards,
Zosi Technology

""" return {'subject': subject, 'html_body': html_body}