List who sent a message in CSV download

This is useful if you have lots of people sending messages and want to
report on who’s doing what.

Needs the API updating to return `created_by_name` in its response.
This commit is contained in:
Chris Hill-Scott
2018-09-06 14:41:55 +01:00
parent 29f5a86ff6
commit 20e71499f0
4 changed files with 79 additions and 34 deletions

View File

@@ -130,7 +130,7 @@ def generate_notifications_csv(**kwargs):
original_column_headers = original_upload.column_headers
fieldnames = ['Row number'] + original_column_headers + ['Template', 'Type', 'Job', 'Status', 'Time']
else:
fieldnames = ['Recipient', 'Template', 'Type', 'Job', 'Status', 'Time']
fieldnames = ['Recipient', 'Template', 'Type', 'Sent by', 'Job', 'Status', 'Time']
yield ','.join(fieldnames) + '\n'
@@ -155,7 +155,8 @@ def generate_notifications_csv(**kwargs):
notification['recipient'],
notification['template_name'],
notification['template_type'],
notification['job_name'],
notification['created_by_name'] or '',
notification['job_name'] or '',
notification['status'],
notification['created_at']
]