Add sender name to the notification

- also ensure that the created time is handled properly
This commit is contained in:
Martyn Inglis
2016-02-25 11:23:04 +00:00
parent 10a764a2c1
commit 44632c36d3
10 changed files with 87 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
from datetime import datetime
from flask import (
Blueprint,
jsonify,
@@ -115,7 +117,8 @@ def send_notification(notification_type, service_id=None, expects_job=False):
send_sms.apply_async((
service_id,
notification_id,
encryption.encrypt(notification)),
encryption.encrypt(notification),
str(datetime.utcnow())),
queue='sms')
else:
send_email.apply_async((
@@ -123,6 +126,7 @@ def send_notification(notification_type, service_id=None, expects_job=False):
notification_id,
template.subject,
"{}@{}".format(service.email_from, current_app.config['NOTIFY_EMAIL_DOMAIN']),
encryption.encrypt(notification)),
encryption.encrypt(notification),
str(datetime.utcnow())),
queue='email')
return jsonify({'notification_id': notification_id}), 201