Skip to content

Commit

Permalink
Merge pull request #444 from collective/gotcha/log-send-mail
Browse files Browse the repository at this point in the history
add some logging when a mail is send
  • Loading branch information
ale-rt authored Jan 16, 2025
2 parents 365a838 + 123a88a commit 2b4fbdd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Changelog
4.3.1 (unreleased)
------------------

- Nothing changed yet.
- Log when sending mail [Mychae1]


4.3.0 (2024-12-13)
Expand Down
9 changes: 9 additions & 0 deletions src/collective/easyform/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,15 @@ def onSuccess(self, fields, request):
mailtext = self.get_mail_text(fields, request, context)
host = api.portal.get_tool(name="MailHost")
host.send(mailtext)
to, from_addr, reply_addr = self.get_addresses(fields, request, context)
logger.info(
"Mail sent from form %r at time %s to %r from address %r with replyto %r",
context.absolute_url(),
DateTime(),
to,
from_addr,
reply_addr,
)


@implementer(ICustomScript)
Expand Down

0 comments on commit 2b4fbdd

Please sign in to comment.