Revision ca4704fb cron_notify_expired.py
b/cron_notify_expired.py | ||
---|---|---|
16 | 16 |
try: |
17 | 17 |
mail_body = render_to_string("rule_expiration.txt", |
18 | 18 |
{"route": route, 'expiration_days':expiration_days}) |
19 |
send_mail(settings.EMAIL_SUBJECT_PREFIX + "Rule %s expires in %s days" % |
|
20 |
(route.name,expiration_days), |
|
19 |
days_num = ' days' |
|
20 |
expiration_days_text = "%s %s" %('in',expiration_days) |
|
21 |
if expiration_days == 0: |
|
22 |
days_num = ' today' |
|
23 |
expiration_days_text = '' |
|
24 |
if expiration_days == 1: |
|
25 |
days_num = ' day' |
|
26 |
send_mail(settings.EMAIL_SUBJECT_PREFIX + "Rule %s expires %s%s" % |
|
27 |
(route.name,expiration_days_text, days_num), |
|
21 | 28 |
mail_body, settings.SERVER_EMAIL, |
22 | 29 |
[route.applier.email]) |
23 | 30 |
except Exception as e: |
Also available in: Unified diff