Merge branch 'master' into refactor-query-filters

This commit is contained in:
Rebecca Law
2016-06-16 17:39:58 +01:00
2 changed files with 60 additions and 17 deletions

View File

@@ -349,7 +349,25 @@ def send_notification(notification_type):
), queue='email')
statsd_client.incr('notifications.api.{}'.format(notification_type))
return jsonify(data={"notification": {"id": notification_id}}), 201
return jsonify(
data=get_notification_return_data(
notification_id,
notification,
template_object)
), 201
def get_notification_return_data(notification_id, notification, template):
output = {
'body': template.replaced,
'template_version': notification['template_version'],
'notification': {'id': notification_id}
}
if template.template_type == 'email':
output.update({'subject': template.subject})
return output
@notifications.route('/notifications/statistics')