mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 17:24:23 -04:00
Add recipient to message previews
When previewing a template on the send page, having the recipient appear as a placeholder should help reinforce the relationship between the columns in the CSV and the placeholders. Then, when previewing a message, having the template populated with the first recipient’s email address/phone number should reinforce that relationship again.
This commit is contained in:
@@ -234,12 +234,14 @@ def check_messages(service_id, template_type, upload_id):
|
||||
|
||||
with suppress(StopIteration):
|
||||
template.values = next(recipients.rows)
|
||||
first_recipient = template.values.get(recipients.recipient_column_header, '')
|
||||
|
||||
session['upload_data']['notification_count'] = len(list(recipients.rows))
|
||||
session['upload_data']['valid'] = not recipients.has_errors
|
||||
return render_template(
|
||||
'views/check.html',
|
||||
recipients=recipients,
|
||||
first_recipient=first_recipient,
|
||||
template=template,
|
||||
page_heading=get_page_headings(template.template_type),
|
||||
errors=get_errors_for_csv(recipients, template.template_type),
|
||||
|
||||
Reference in New Issue
Block a user