From 4ce16386d6ff51bf00af389817ea98b4bab1d2d4 Mon Sep 17 00:00:00 2001 From: Andrew Leith Date: Mon, 6 May 2024 18:34:27 +0000 Subject: [PATCH] feat(magic-link): send magic link email --- app/user/rest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/user/rest.py b/app/user/rest.py index a80e280548..4ca31c0ff8 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -317,7 +317,11 @@ def send_user_email_code(user_to_send_to, data): secret_code = create_secret_code() - personalisation = {"name": user_to_send_to.name, "verify_code": secret_code} + personalisation = { + "name": user_to_send_to.name, + "link_url_en": "{}/magic-login-link/{}".format(current_app.config["ADMIN_BASE_URL"], secret_code), + "link_url_fr": "{}/magic-login-link/{}?lang=fr".format(current_app.config["ADMIN_BASE_URL"], secret_code), + } create_2fa_code( current_app.config["EMAIL_2FA_TEMPLATE_ID"],