Django: Mailgun удаляет теги в моем письме
У меня есть этот шаблон письма
<p>If you have any questions or would like feedback on your profile, please do not hesitate to contact us. To make the changes, you can go <a href="https://languageloom.academy/teacher/edit-profile/">here</a> to view and manage your account.</p>
но когда я отправляю письмо таким образом
@shared_task
def send_email_task(
subject: str,
message: str,
from_email: str,
recipient_list: list[str],
html_message: str = None,
):
"""
A Celery task to send an email.
:param subject: Subject of the email.
:param message: Body of the email (plain text).
:param from_email: Sender's email address.
:param recipient_list: A list of recipient email addresses.
:param html_message: HTML content of the email (optional).
:return: True if the email is sent successfully, False otherwise.
"""
try:
msg = EmailMultiAlternatives(subject, message, from_email, recipient_list)
# Attach HTML content if provided
if html_message:
msg.attach_alternative(html_message, "text/html")
msg.send()
return True
except smtplib.SMTPException as e:
logger.error(f"Email sending failed: {e}")
return False
он успешно отправляет письмо, но в теге a его href удален
В настройках mailgun у меня не включено отслеживание.