mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 10:12:32 -05:00
Update to config to pull out from email address.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from datetime import datetime
|
||||
from flask import (jsonify, request, abort, Blueprint)
|
||||
from flask import (jsonify, request, abort, Blueprint, current_app)
|
||||
from sqlalchemy.exc import DataError
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
from app.dao.services_dao import get_model_services
|
||||
@@ -141,7 +141,7 @@ def send_user_code(user_id):
|
||||
email = user.email_address if verify_code.get('to', None) is None else verify_code.get('to')
|
||||
notification = {
|
||||
'to_address': email,
|
||||
'from_address': 'notify@digital.cabinet-office.gov.uk',
|
||||
'from_address': current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'],
|
||||
'subject': 'Verification code',
|
||||
'body': secret_code}
|
||||
add_notification_to_queue(api_user['client'], 'admin', 'email', notification)
|
||||
|
||||
@@ -20,6 +20,7 @@ class Config(object):
|
||||
NOTIFY_JOB_QUEUE = os.getenv('NOTIFY_JOB_QUEUE', 'notify-jobs-queue')
|
||||
# Notification Queue names are a combination of a prefx plus a name
|
||||
NOTIFICATION_QUEUE_PREFIX = 'notification'
|
||||
VERIFY_CODE_FROM_EMAIL_ADDRESS = 'notify@digital.cabinet-office.gov.uk'
|
||||
|
||||
|
||||
class Development(Config):
|
||||
@@ -31,6 +32,7 @@ class Development(Config):
|
||||
DELIVERY_CLIENT_USER_NAME = 'dev-notify-delivery'
|
||||
DELIVERY_CLIENT_SECRET = 'dev-notify-secret-key'
|
||||
NOTIFICATION_QUEUE_PREFIX = 'notification_development'
|
||||
VERIFY_CODE_FROM_EMAIL_ADDRESS = 'notify-tests-preview@digital.cabinet-office.gov.uk'
|
||||
|
||||
|
||||
class Test(Development):
|
||||
@@ -40,6 +42,7 @@ class Test(Development):
|
||||
|
||||
class Preview(Config):
|
||||
NOTIFICATION_QUEUE_PREFIX = 'notification_preview'
|
||||
VERIFY_CODE_FROM_EMAIL_ADDRESS = 'notify-tests-preview@digital.cabinet-office.gov.uk'
|
||||
|
||||
|
||||
class Staging(Config):
|
||||
|
||||
Reference in New Issue
Block a user