[WEB-5917] fix: generate clean plain text from HTML email template #8535
This commit is contained in:
parent
e9b011896d
commit
f0dcf66167
12 changed files with 65 additions and 23 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue