add new template to config

and rename existing new user email verification template for clarity
This commit is contained in:
Leo Hemsted
2017-11-03 14:38:30 +00:00
parent 57b7a392b2
commit dd326ec1d3
4 changed files with 12 additions and 11 deletions

View File

@@ -125,7 +125,8 @@ class Config(object):
NOTIFY_USER_ID = '6af522d0-2915-4e52-83a3-3690455a5fe6'
INVITATION_EMAIL_TEMPLATE_ID = '4f46df42-f795-4cc4-83bb-65ca312f49cc'
SMS_CODE_TEMPLATE_ID = '36fb0730-6259-4da1-8a80-c8de22ad4246'
EMAIL_VERIFY_CODE_TEMPLATE_ID = 'ece42649-22a8-4d06-b87f-d52d5d3f0a27'
EMAIL_2FA_TEMPLATE_ID = '299726d2-dba6-42b8-8209-30e1d66ea164'
NEW_USER_EMAIL_VERIFICATION_TEMPLATE_ID = 'ece42649-22a8-4d06-b87f-d52d5d3f0a27'
PASSWORD_RESET_TEMPLATE_ID = '474e9242-823b-4f99-813d-ed392e7f1201'
ALREADY_REGISTERED_EMAIL_TEMPLATE_ID = '0880fbb1-a0c6-46f0-9a8e-36c986381ceb'
CHANGE_EMAIL_CONFIRMATION_TEMPLATE_ID = 'eb4d9930-87ab-4aef-9bce-786762687884'

View File

@@ -171,7 +171,7 @@ def send_user_email_code(user_id):
create_user_code(user_to_send_to, uuid.uuid4(), EMAIL_TYPE)
template = dao_get_template_by_id(current_app.config['EMAIL_CODE_TEMPLATE_ID'])
template = dao_get_template_by_id(current_app.config['EMAIL_2FA_TEMPLATE_ID'])
personalisation = {'url': _create_2fa_url(user_to_send_to)},
create_2fa_code(template, user_to_send_to.email_address, personalisation)
@@ -238,13 +238,13 @@ def send_user_confirm_new_email(user_id):
@user_blueprint.route('/<uuid:user_id>/email-verification', methods=['POST'])
def send_user_email_verification(user_id):
def send_new_user_email_verification(user_id):
# when registering, we verify all users' email addresses using this function
user_to_send_to = get_user_by_id(user_id=user_id)
secret_code = create_secret_code()
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['NEW_USER_EMAIL_VERIFICATION_TEMPLATE_ID'])
service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
saved_notification = persist_notification(