Skip to content

Commit 6fc0870

Browse files
authored
Merge pull request #745 from uw-it-aca/task/shared-drive-notifications
access lifecycle warning recipient name
2 parents 8c4307c + c4d2549 commit 6fc0870

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

endorsement/notifications/access.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ def _create_accessor_message(access_record, emails):
7676
loader.render_to_string(html_template, params))
7777

7878

79-
def _create_accessee_expiration_notice(notice_level, access, policy):
79+
def _create_accessee_expiration_notice(notice_level, owner, access, policy):
8080
context = {
81+
'owner': owner,
8182
'access': access,
8283
'lifetime': policy.lifetime,
8384
'notice_time': policy.days_till_expiration(notice_level)
@@ -104,15 +105,17 @@ def accessee_lifecycle_warning(notice_level):
104105

105106
for drive in drives:
106107
try:
107-
owner = get_owner_for_shared_netid(drive.accessee.netid)
108-
if not owner:
109-
owner = drive.accessee.netid
108+
owner_netid = get_owner_for_shared_netid(drive.accessee.netid)
109+
if owner_netid:
110+
owner = get_accessee_model(owner_netid)
111+
else:
112+
owner = drive.accessee
110113

111-
email = [uw_email_address(owner)]
114+
email = [uw_email_address(owner.netid)]
112115
(subject,
113116
text_body,
114117
html_body) = _create_accessee_expiration_notice(
115-
notice_level, drive, policy)
118+
notice_level, owner, drive, policy)
116119
send_notification(
117120
email, subject, text_body, html_body,
118121
"Mailbox Access Warning")

endorsement/templates/email/access/notice_warning.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Hello {{access.accessee.display_name}} ({{access.accessee.netid}}),
1+
Hello {{owner.display_name}} ({{owner.netid}}),
22
<p>
33
You are receiving this message because you used the Provisioning Request
44
Tool (PRT) to provision access to a UW Office 365 Exchange Online mailbox

endorsement/templates/email/access/notice_warning.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Hello {{access.accessee.display_name}} ({{access.accessee.netid}}),
1+
Hello {{owner.display_name}} ({{owner.netid}}),
22

33
You are receiving this message because you used the Provisioning Request
44
Tool (PRT) to provision access to a UW Office 365 Exchange Online mailbox

endorsement/templates/email/access/notice_warning_final.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Hello {{access.accessee.display_name}} ({{access.accessee.netid}}),
1+
Hello {{owner.display_name}} ({{owner.netid}}),
22
<p>
33
You are receiving this message because you used the Provisioning Request Tool (PRT) to provision access to a UW Office 365 Exchange Online mailbox for another UW NetID.
44
</p>

endorsement/templates/email/access/notice_warning_final.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Hello {{access.accessee.display_name}} ({{access.accessee.netid}}),
1+
Hello {{owner.display_name}} ({{owner.netid}}),
22

33
You are receiving this message because you used the Provisioning Request
44
Tool (PRT) to provision access to a UW Office 365 Exchange Online mailbox

0 commit comments

Comments
 (0)