mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Use notify to send email verification
This commit is contained in:
@@ -589,3 +589,37 @@ def sms_code_template(notify_db,
|
||||
template = Template(**data)
|
||||
db.session.add(template)
|
||||
return template
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def email_verification_template(notify_db,
|
||||
notify_db_session):
|
||||
user = sample_user(notify_db, notify_db_session)
|
||||
service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
|
||||
if not service:
|
||||
data = {
|
||||
'id': current_app.config['NOTIFY_SERVICE_ID'],
|
||||
'name': 'Notify Service',
|
||||
'message_limit': 1000,
|
||||
'active': True,
|
||||
'restricted': False,
|
||||
'email_from': 'notify.service',
|
||||
'created_by': user
|
||||
}
|
||||
service = Service(**data)
|
||||
db.session.add(service)
|
||||
|
||||
template = Template.query.get(current_app.config['SMS_CODE_TEMPLATE_ID'])
|
||||
if not template:
|
||||
data = {
|
||||
'id': current_app.config['EMAIL_VERIFY_CODE_TEMPLATE_ID'],
|
||||
'name': 'Email verification template',
|
||||
'template_type': 'email',
|
||||
'content': '((user_name)) use ((url)) to complete registration',
|
||||
'service': service,
|
||||
'created_by': user,
|
||||
'archived': False
|
||||
}
|
||||
template = Template(**data)
|
||||
db.session.add(template)
|
||||
return template
|
||||
|
||||
Reference in New Issue
Block a user