Skip to content

Commit

Permalink
v2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GitRon committed May 31, 2024
1 parent bf6da12 commit 7c7da93
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

* *2.1.1* (2024-05-31)
* Changed log-level to "info" for successful dispatching
* Improved configuration docs

* *2.1.0* (2024-05-27)
* Added `ThreadEmailService` for simple async sending of emails
* Added basic logging with privacy configuration to mail class
Expand Down
2 changes: 1 addition & 1 deletion django_pony_express/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Class-based emails including a test suite for Django"""

__version__ = "2.1.0"
__version__ = "2.1.1"
4 changes: 2 additions & 2 deletions django_pony_express/services/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ def _send_and_log_email(self, msg: EmailMultiAlternatives) -> bool:
try:
result = msg.send()
if PONY_LOG_RECIPIENTS:
self._logger.debug(_('Email "%s" successfully sent to %s.') % (msg.subject, recipients_as_string))
self._logger.info(_('Email "%s" successfully sent to %s.') % (msg.subject, recipients_as_string))
else:
self._logger.debug(_('Email "%s" successfully sent.') % msg.subject)
self._logger.info(_('Email "%s" successfully sent.') % msg.subject)
except Exception as e:
if PONY_LOG_RECIPIENTS:
self._logger.error(
Expand Down
2 changes: 1 addition & 1 deletion docs/features/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LOGGING = {
"loggers": {
"django_pony_express": {
"handlers": ["console"],
"level": "INFO",
"level": "DEBUG",
"propagate": True,
},
...
Expand Down
4 changes: 2 additions & 2 deletions tests/services/base/test_base_mail_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def test_send_and_log_email_success_privacy_active(self, mock_logger):
msg=EmailMultiAlternatives(subject="The Pony Express", to=["[email protected]"])
)

mock_logger.debug.assert_called_with('Email "The Pony Express" successfully sent.')
mock_logger.info.assert_called_with('Email "The Pony Express" successfully sent.')
self.assertEqual(result, 1)

@mock.patch("django_pony_express.services.base.BaseEmailService._logger")
Expand All @@ -326,7 +326,7 @@ def test_send_and_log_success_privacy_inactive(self, mock_logger):
msg=EmailMultiAlternatives(subject="The Pony Express", to=["[email protected]"])
)

mock_logger.debug.assert_called_with('Email "The Pony Express" successfully sent to [email protected].')
mock_logger.info.assert_called_with('Email "The Pony Express" successfully sent to [email protected].')
self.assertEqual(result, 1)

@mock.patch.object(EmailMultiAlternatives, "send", side_effect=Exception("Broken pony"))
Expand Down

0 comments on commit 7c7da93

Please sign in to comment.