|
|
|
@ -82,13 +82,22 @@ def environment_callback(request): |
|
|
|
|
|
|
|
|
|
|
|
def send_email(recipient, code): |
|
|
|
send_mail( |
|
|
|
'Test Email', |
|
|
|
f'This is a test email {code} from Django using Gmail SMTP.', |
|
|
|
'aliabdolahi.171@gmail.com', |
|
|
|
recipient, |
|
|
|
fail_silently=False, |
|
|
|
) |
|
|
|
from apps.account.tasks import send_resend_email_task |
|
|
|
subject = 'Verification Code' |
|
|
|
html_content = f""" |
|
|
|
<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; border: 1px solid #e0e0e0; border-radius: 10px;"> |
|
|
|
<h2 style="color: #333; text-align: center;">Verification Code</h2> |
|
|
|
<p style="font-size: 16px; color: #555;">Hello,</p> |
|
|
|
<p style="font-size: 16px; color: #555;">Your verification code for <strong>Imam Javad App</strong> is:</p> |
|
|
|
<div style="text-align: center; margin: 30px 0;"> |
|
|
|
<span style="font-size: 32px; font-weight: bold; color: #007bff; letter-spacing: 5px; background: #f8f9fa; padding: 10px 20px; border-radius: 5px; border: 1px dashed #007bff;">{code}</span> |
|
|
|
</div> |
|
|
|
<p style="font-size: 14px; color: #777; text-align: center;">This code will expire shortly. If you did not request this code, please ignore this email.</p> |
|
|
|
<hr style="border: 0; border-top: 1px solid #eee; margin: 20px 0;"> |
|
|
|
<p style="font-size: 12px; color: #999; text-align: center;">Sent via Resend API</p> |
|
|
|
</div> |
|
|
|
""" |
|
|
|
send_resend_email_task.delay(recipient, subject, html_content) |
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
|