[ZBKBCK-346] change password and forgot password api has been optimised

This commit is contained in:
Ruman Siddiqui
2023-08-18 16:57:42 +05:30
parent 4bc91abebf
commit 71a3e36bf3
4 changed files with 103 additions and 48 deletions

View File

@ -129,6 +129,28 @@ def send_otp_email(recipient_email, otp):
)
return otp
@shared_task()
def send_all_email(template_name, email, otp):
"""
Send all type of email by passing template name
template_name: string
email: string
otp: string
"""
from_email = settings.EMAIL_FROM_ADDRESS
recipient_list = [email]
send_templated_mail(
template_name=template_name,
from_email=from_email,
recipient_list=recipient_list,
context={
'verification_code': otp
}
)
return otp
@shared_task
def user_device_details(user, device_id):
"""