Skip to content

Commit 3c6ca91

Browse files
author
Adrian Berger
committed
fix: add proper to handling
1 parent f1a6f3f commit 3c6ca91

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

django_mailomat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from django_mailomat.backend import MailomatEmailBackend
22

3-
__version__ = '0.4.0'
3+
__version__ = '0.5.0'
44
__all__ = ['MailomatEmailBackend']

django_mailomat/backend.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from django.conf import settings
77
from django.core.mail.backends.base import BaseEmailBackend
88
from django.core.mail.message import EmailMessage, EmailMultiAlternatives
9+
from django.utils.html import strip_tags
910

1011
logger = logging.getLogger(__name__)
1112

@@ -48,9 +49,9 @@ def _send(self, email_message: Union[EmailMessage, EmailMultiAlternatives]) -> b
4849

4950
# Prepare email data
5051
data = {
51-
'to': [self._sanitize_email(recipient) for recipient in email_message.recipients()],
52+
'to': [{'email': self._sanitize_email(recipient)} for recipient in email_message.recipients()],
5253
'subject': email_message.subject,
53-
'text': email_message.body,
54+
'text': strip_tags(email_message.body),
5455
'html': None,
5556
'from': self._format_email(
5657
email_message.from_email,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "django-mailomat"
7-
version = "0.4.0"
7+
version = "0.5.0"
88
description = "Django email backend for Mailomat API"
99
readme = "README.md"
1010
requires-python = ">=3.9"

0 commit comments

Comments
 (0)