[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

@ -20,7 +20,6 @@ from django.db.models import Prefetch
from django.core.mail import EmailMultiAlternatives, get_connection
from django.core.serializers.json import DjangoJSONEncoder
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.core.exceptions import ObjectDoesNotExist
# Module imports
@ -51,6 +50,7 @@ from plane.db.models import (
IssueAssignee,
)
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
from plane.settings.mongo import MongoConnection
@ -222,7 +222,7 @@ def send_webhook_deactivation_email(webhook_id: str, receiver_id: str, current_s
"webhook_url": f"{current_site}/{str(webhook.workspace.slug)}/settings/webhooks/{str(webhook.id)}",
}
html_content = render_to_string("emails/notifications/webhook-deactivate.html", context)
text_content = strip_tags(html_content)
text_content = generate_plain_text_from_html(html_content)
# Set the email connection
connection = get_connection(