From 9675380e62c06f115d9dff8c057bc87e58e669b9 Mon Sep 17 00:00:00 2001 From: Hitesh Ghuge <41512916+hiteshghuge@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:10:17 +0530 Subject: [PATCH] New user mail (#1445) * - new user email issue * - new user email issue --------- Co-authored-by: hghuge --- kairon/api/app/routers/user.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kairon/api/app/routers/user.py b/kairon/api/app/routers/user.py index 8184f6e61..eec9e1b1a 100644 --- a/kairon/api/app/routers/user.py +++ b/kairon/api/app/routers/user.py @@ -72,12 +72,12 @@ async def allow_bot_for_user( current_user.account, allow_bot.role) if Utility.email_conf["email"]["enable"]: accessor_name = AccountProcessor.get_user(allow_bot.email, raise_error=False) - if not accessor_name: - accessor_name = {} + accessor = "Buddy" + if accessor_name: + accessor = f"{accessor_name.get('first_name')} {accessor_name.get('last_name')}" background_tasks.add_task(MailUtility.format_and_send_mail, mail_type='add_member', email=allow_bot.email, url=url, first_name=f'{current_user.first_name} {current_user.last_name}', - bot_name=bot_name, role=allow_bot.role.value, - accessor_name=f"{accessor_name.get('first_name')} {accessor_name.get('last_name')}") + bot_name=bot_name, role=allow_bot.role.value, accessor_name=accessor) return Response(message='An invitation has been sent to the user') else: return {"message": "User added"}