mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-11 07:38:56 +00:00
30 lines
673 B
Python
30 lines
673 B
Python
"""
|
|
web_admin tasks file
|
|
"""
|
|
# third party imports
|
|
from celery import shared_task
|
|
from templated_email import send_templated_mail
|
|
|
|
# django imports
|
|
from django.conf import settings
|
|
|
|
|
|
@shared_task
|
|
def send_email_otp(email, verification_code):
|
|
"""
|
|
used to send otp on email
|
|
:param email: e-mail
|
|
:param verification_code: otp
|
|
"""
|
|
from_email = settings.EMAIL_FROM_ADDRESS
|
|
recipient_list = [email]
|
|
send_templated_mail(
|
|
template_name='email_reset_verification.email',
|
|
from_email=from_email,
|
|
recipient_list=recipient_list,
|
|
context={
|
|
'verification_code': verification_code
|
|
}
|
|
)
|
|
return True
|