mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Ensure that all persist notification methods use service not service ID
This commit is contained in:
@@ -174,13 +174,13 @@ def send_user_confirm_new_email(user_id):
|
|||||||
raise InvalidRequest(message=errors, status_code=400)
|
raise InvalidRequest(message=errors, status_code=400)
|
||||||
|
|
||||||
template = dao_get_template_by_id(current_app.config['CHANGE_EMAIL_CONFIRMATION_TEMPLATE_ID'])
|
template = dao_get_template_by_id(current_app.config['CHANGE_EMAIL_CONFIRMATION_TEMPLATE_ID'])
|
||||||
notify_service_id = current_app.config['NOTIFY_SERVICE_ID']
|
service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
|
||||||
|
|
||||||
saved_notification = persist_notification(
|
saved_notification = persist_notification(
|
||||||
template_id=template.id,
|
template_id=template.id,
|
||||||
template_version=template.version,
|
template_version=template.version,
|
||||||
recipient=email['email'],
|
recipient=email['email'],
|
||||||
service_id=notify_service_id,
|
service=service,
|
||||||
personalisation={
|
personalisation={
|
||||||
'name': user_to_send_to.name,
|
'name': user_to_send_to.name,
|
||||||
'url': _create_confirmation_url(user=user_to_send_to, email_address=email['email']),
|
'url': _create_confirmation_url(user=user_to_send_to, email_address=email['email']),
|
||||||
@@ -202,12 +202,13 @@ def send_user_email_verification(user_id):
|
|||||||
create_user_code(user_to_send_to, secret_code, 'email')
|
create_user_code(user_to_send_to, secret_code, 'email')
|
||||||
|
|
||||||
template = dao_get_template_by_id(current_app.config['EMAIL_VERIFY_CODE_TEMPLATE_ID'])
|
template = dao_get_template_by_id(current_app.config['EMAIL_VERIFY_CODE_TEMPLATE_ID'])
|
||||||
|
service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
|
||||||
|
|
||||||
saved_notification = persist_notification(
|
saved_notification = persist_notification(
|
||||||
template_id=template.id,
|
template_id=template.id,
|
||||||
template_version=template.version,
|
template_version=template.version,
|
||||||
recipient=user_to_send_to.email_address,
|
recipient=user_to_send_to.email_address,
|
||||||
service_id=current_app.config['NOTIFY_SERVICE_ID'],
|
service=service,
|
||||||
personalisation={
|
personalisation={
|
||||||
'name': user_to_send_to.name,
|
'name': user_to_send_to.name,
|
||||||
'url': _create_verification_url(user_to_send_to, secret_code)
|
'url': _create_verification_url(user_to_send_to, secret_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user