Support email

This commit is contained in:
jain
2023-07-11 16:33:03 +05:30
parent 8b4db3e2e9
commit efa121640f
7 changed files with 67 additions and 6 deletions

View File

@ -46,6 +46,22 @@ def send_otp_email(recipient_email, otp):
)
return otp
def send_support_email(name, sender, subject, message):
"""Send otp on email with template"""
to_email = [settings.EMAIL_FROM_ADDRESS]
from_email = settings.DEFAULT_ADDRESS
send_templated_mail(
template_name='support_mail.email',
from_email=from_email,
recipient_list=to_email,
context={
'name': name.title(),
'sender': sender,
'subject': subject,
'message': message
}
)
return name
def custom_response(detail, data=None, response_status=status.HTTP_200_OK):
"""Custom response code"""
if not data: