Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
feature #556 fix issue #443 #139 spool send event result (umanit, Nic…
…olas Appriou)

This PR was merged into the 5.3-dev branch.

Discussion
----------

fix issue #443 #139 spool send event result

Here is a PR for issues #443 and #139.

We've added a new result status in SendEvents with code 0x11 (RESULT_PENDING | RESULT_SPOOLED). It seems logical to us because this status lies between those two status.

The SpoolTransport now set RESULT_SPOOLED instead of RESULT_SUCCESS in order to be able to make the difference between a spooled mail and a sent mail.

Unit tests fails, but it wasn't due to anything that we've added. The master branch unit tests was already broken when we cloned the project.

Commits
-------

7b20f44 empty commit
33fa890 fix issue #443 #139 spool send event result
  • Loading branch information
fabpot committed Mar 14, 2015
2 parents 0c75af4 + 7b20f44 commit 7186319
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/classes/Swift/Events/SendEvent.php
Expand Up @@ -18,6 +18,9 @@ class Swift_Events_SendEvent extends Swift_Events_EventObject
/** Sending has yet to occur */
const RESULT_PENDING = 0x0001;

/** Email is spooled, ready to be sent */
const RESULT_SPOOLED = 0x0011;

/** Sending was successful */
const RESULT_SUCCESS = 0x0010;

Expand Down
2 changes: 1 addition & 1 deletion lib/classes/Swift/Transport/SpoolTransport.php
Expand Up @@ -98,7 +98,7 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
$success = $this->_spool->queueMessage($message);

if ($evt) {
$evt->setResult($success ? Swift_Events_SendEvent::RESULT_SUCCESS : Swift_Events_SendEvent::RESULT_FAILED);
$evt->setResult($success ? Swift_Events_SendEvent::RESULT_SPOOLED : Swift_Events_SendEvent::RESULT_FAILED);
$this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed');
}

Expand Down

0 comments on commit 7186319

Please sign in to comment.