[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/composer/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ -> SendEvent.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of SwiftMailer.
   5   * (c) 2004-2009 Chris Corbyn
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  /**
  12   * Generated when a message is being sent.
  13   *
  14   * @author Chris Corbyn
  15   */
  16  class Swift_Events_SendEvent extends Swift_Events_EventObject
  17  {
  18      /** Sending has yet to occur */
  19      const RESULT_PENDING = 0x0001;
  20  
  21      /** Email is spooled, ready to be sent */
  22      const RESULT_SPOOLED = 0x0011;
  23  
  24      /** Sending was successful */
  25      const RESULT_SUCCESS = 0x0010;
  26  
  27      /** Sending worked, but there were some failures */
  28      const RESULT_TENTATIVE = 0x0100;
  29  
  30      /** Sending failed */
  31      const RESULT_FAILED = 0x1000;
  32  
  33      /**
  34       * The Message being sent.
  35       *
  36       * @var Swift_Mime_SimpleMessage
  37       */
  38      private $message;
  39  
  40      /**
  41       * Any recipients which failed after sending.
  42       *
  43       * @var string[]
  44       */
  45      private $failedRecipients = [];
  46  
  47      /**
  48       * The overall result as a bitmask from the class constants.
  49       *
  50       * @var int
  51       */
  52      private $result;
  53  
  54      /**
  55       * Create a new SendEvent for $source and $message.
  56       */
  57      public function __construct(Swift_Transport $source, Swift_Mime_SimpleMessage $message)
  58      {
  59          parent::__construct($source);
  60          $this->message = $message;
  61          $this->result = self::RESULT_PENDING;
  62      }
  63  
  64      /**
  65       * Get the Transport used to send the Message.
  66       *
  67       * @return Swift_Transport
  68       */
  69      public function getTransport()
  70      {
  71          return $this->getSource();
  72      }
  73  
  74      /**
  75       * Get the Message being sent.
  76       *
  77       * @return Swift_Mime_SimpleMessage
  78       */
  79      public function getMessage()
  80      {
  81          return $this->message;
  82      }
  83  
  84      /**
  85       * Set the array of addresses that failed in sending.
  86       *
  87       * @param array $recipients
  88       */
  89      public function setFailedRecipients($recipients)
  90      {
  91          $this->failedRecipients = $recipients;
  92      }
  93  
  94      /**
  95       * Get an recipient addresses which were not accepted for delivery.
  96       *
  97       * @return string[]
  98       */
  99      public function getFailedRecipients()
 100      {
 101          return $this->failedRecipients;
 102      }
 103  
 104      /**
 105       * Set the result of sending.
 106       *
 107       * @param int $result
 108       */
 109      public function setResult($result)
 110      {
 111          $this->result = $result;
 112      }
 113  
 114      /**
 115       * Get the result of this Event.
 116       *
 117       * The return value is a bitmask from
 118       * {@see RESULT_PENDING, RESULT_SUCCESS, RESULT_TENTATIVE, RESULT_FAILED}
 119       *
 120       * @return int
 121       */
 122      public function getResult()
 123      {
 124          return $this->result;
 125      }
 126  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1