[WEB-5917] fix: generate clean plain text from HTML email template #8535

This commit is contained in:
b-saikrishnakanth 2026-02-17 00:44:52 +05:30 committed by GitHub
parent e9b011896d
commit f0dcf66167
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 65 additions and 23 deletions

View file

@ -12,10 +12,10 @@ from celery import shared_task
# Third party imports
from django.core.mail import EmailMultiAlternatives, get_connection
from django.template.loader import render_to_string
from django.utils.html import strip_tags
# Module imports
from plane.license.utils.instance_value import get_email_configuration
from plane.utils.email import generate_plain_text_from_html
from plane.utils.exception_logger import log_exception
@ -37,7 +37,7 @@ def magic_link(email, key, token):
context = {"code": token, "email": email}
html_content = render_to_string("emails/auth/magic_signin.html", context)
text_content = strip_tags(html_content)
text_content = generate_plain_text_from_html(html_content)
connection = get_connection(
host=EMAIL_HOST,