示例#1
0
 /**
  *
  * @since 2.0.0
  *
  * @param Prompt_Email_Batch $batch
  * @param Prompt_Interface_Http_Client|null $client
  * @param PHPMailer|null $local_mailer
  * @param int $chunk
  */
 public function __construct(Prompt_Email_Batch $batch, Prompt_Interface_Http_Client $client = null, PHPMailer $local_mailer = null, $chunk = 0)
 {
     parent::__construct($batch, $client);
     $this->chunk = $chunk;
     $this->handlebars = new Prompt_Handlebars();
     $this->local_mailer = $local_mailer ? $local_mailer : $this->get_phpmailer();
 }
示例#2
0
 /**
  * Add idempotent checks, flood control and batch recording to the parent send method.
  *
  * @since 2.0.0
  */
 public function send()
 {
     $this->batch->lock_for_sending();
     $result = parent::send();
     if ($result and !is_wp_error($result)) {
         $this->record_successful_outbound_message_batch($result);
     }
     return $result;
 }
示例#3
0
 /**
  * Add idempotent checks and batch recording to the parent send method.
  *
  * @since 2.0.0
  *
  * @return null|object|WP_Error
  */
 public function send()
 {
     $this->batch->set_individual_message_values(array())->add_unsent_recipients()->lock_for_sending();
     $result = parent::send();
     if ($result and !is_wp_error($result)) {
         $this->record_successful_outbound_message_batch($result);
     }
     return $result;
 }
 /**
  * @since 2.0.0
  *
  * @param Prompt_Subscription_Agreement_Email_Batch $batch
  * @param Prompt_Interface_Http_Client $client
  */
 public function __construct(Prompt_Subscription_Agreement_Email_Batch $batch, Prompt_Interface_Http_Client $client = null)
 {
     parent::__construct($batch, $client);
 }