mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Template and personalisation content is now merged and returned with
notifications, when retrieved by notification id, or service id (i.e. all notifications for service). There is a new element returned at top level of notification json called body, which is the template content merged with personalisation. This is consistent with api to endpoint to create notification which returns what was sent as 'body' in json response. Merging of template with personalisation is done in the NotificationStatusSchema. Personalisation data in encrypted before storing in db.
This commit is contained in:
@@ -320,7 +320,8 @@ def sample_notification(notify_db,
|
||||
reference=None,
|
||||
created_at=datetime.utcnow(),
|
||||
content_char_count=160,
|
||||
create=True):
|
||||
create=True,
|
||||
personalisation=None):
|
||||
if service is None:
|
||||
service = sample_service(notify_db, notify_db_session)
|
||||
if template is None:
|
||||
@@ -347,7 +348,8 @@ def sample_notification(notify_db,
|
||||
'status': status,
|
||||
'reference': reference,
|
||||
'created_at': created_at,
|
||||
'content_char_count': content_char_count
|
||||
'content_char_count': content_char_count,
|
||||
'personalisation': personalisation
|
||||
}
|
||||
if job_row_number:
|
||||
data['job_row_number'] = job_row_number
|
||||
|
||||
Reference in New Issue
Block a user