[GH-ISSUE #424] SwiftMailerHandler::send clone message date issue #146

Closed
opened 2026-03-04 02:12:37 +03:00 by kerem · 1 comment
Owner

Originally created by @fyrye on GitHub (Sep 23, 2014).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/424

The message is cloned resulting in the initial date from instantiation remaining which is inaccurate.
https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/SwiftMailerHandler.php

Propose
Add getMessage() method in order for manual altering of message
or
Add $message->setDate(time()) to the send method after cloning.

For example a long running script that runs for any length of time would send an email message with a date from the past as opposed to the actual date it was sent.

Originally created by @fyrye on GitHub (Sep 23, 2014). Original GitHub issue: https://github.com/Seldaek/monolog/issues/424 The message is cloned resulting in the initial date from instantiation remaining which is inaccurate. https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/SwiftMailerHandler.php Propose Add getMessage() method in order for manual altering of message or Add $message->setDate(time()) to the send method after cloning. For example a long running script that runs for any length of time would send an email message with a date from the past as opposed to the actual date it was sent.
kerem 2026-03-04 02:12:37 +03:00
  • closed this issue
  • added the
    Bug
    label
Author
Owner

@Seldaek commented on GitHub (Sep 29, 2014):

Thanks for the hint, I fixed it with your second proposal.

<!-- gh-comment-id:57241195 --> @Seldaek commented on GitHub (Sep 29, 2014): Thanks for the hint, I fixed it with your second proposal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#146
No description provided.