Skip to content

Commit

Permalink
New user mail (#1445)
Browse files Browse the repository at this point in the history
* - new user email issue

* - new user email issue

---------

Co-authored-by: hghuge <[email protected]>
  • Loading branch information
hiteshghuge and hghuge authored Aug 22, 2024
1 parent 0043eb9 commit 9675380
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kairon/api/app/routers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit 9675380

Please sign in to comment.