31
31
32
32
EMAIL_ADMINS_ON_ALLOCATION_EXPIRE = import_from_settings ('EMAIL_ADMINS_ON_ALLOCATION_EXPIRE' )
33
33
EMAIL_ADMIN_LIST = import_from_settings ('EMAIL_ADMIN_LIST' )
34
+ ADMIN_REMINDER_EMAIL = import_from_settings ('ADMIN_REMINDER_EMAIL' )
34
35
35
36
def update_statuses ():
36
37
@@ -69,12 +70,14 @@ def send_request_reminder_emails():
69
70
'signature' : EMAIL_SIGNATURE ,
70
71
'url_base' : f'{ CENTER_BASE_URL .strip ("/" )} /allocation/change-request/'
71
72
}
72
- send_admin_email_template (
73
- 'Pending Allocation Changes' ,
74
- 'email/pending_allocation_changes.txt' ,
75
- allocation_change_template_context ,
76
- )
77
73
74
+ send_email_template (
75
+ subject = 'Pending Allocation Changes' ,
76
+ template_name = 'email/pending_allocation_changes.txt' ,
77
+ template_context = allocation_change_template_context ,
78
+ sender = EMAIL_SENDER ,
79
+ receiver_list = [ADMIN_REMINDER_EMAIL ,],
80
+ )
78
81
# Allocation Requests are allocations marked as "new"
79
82
pending_allocations = Allocation .objects .filter (
80
83
status__name = 'New' , created__lte = req_alert_date
@@ -87,11 +90,15 @@ def send_request_reminder_emails():
87
90
'signature' : EMAIL_SIGNATURE ,
88
91
'url_base' : f'{ CENTER_BASE_URL .strip ("/" )} /allocation/'
89
92
}
90
- send_admin_email_template (
91
- 'Pending Allocations' ,
92
- 'email/pending_allocations.txt' ,
93
- new_allocation_template_context ,
93
+
94
+ send_email_template (
95
+ subject = 'Pending Allocations' ,
96
+ template_name = 'email/pending_allocations.txt' ,
97
+ template_context = new_allocation_template_context ,
98
+ sender = EMAIL_SENDER ,
99
+ receiver_list = [ADMIN_REMINDER_EMAIL ,],
94
100
)
101
+
95
102
# return statement for testing
96
103
return (pending_changerequests , pending_allocations )
97
104
0 commit comments