public function queue($ts = null)
    {
        $recipients = $this->to();
        $author     = $this->from();
        $subject    = $this->subject();
        $msgHtml    = $this->msgHtml();
        $msgTxt     = $this->msgTxt();
        $campaign   = $this->campaign();
        $queueId    = $this->queueId();

        foreach ($recipients as $to) {
            $queueItem = $this->queueItemFactory()->create(EmailQueueItem::class);

            $queueItem->setTo($to);
            $queueItem->setFrom($author);
            $queueItem->setSubject($subject);
            $queueItem->setMsgHtml($msgHtml);
            $queueItem->setMsgTxt($msgTxt);
            $queueItem->setCampaign($campaign);
            $queueItem->setProcessingDate($ts);
            $queueItem->setQueueId($queueId);

            $res = $queueItem->save();
        }

        return true;
    }
public function queue($ts = null)
    {
        $recipients = $this->to();
        $author     = $this->from();
        $subject    = $this->subject();
        $msgHtml    = $this->msgHtml();
        $msgTxt     = $this->msgTxt();
        $campaign   = $this->campaign();
        $queueId    = $this->queueId();

        foreach ($recipients as $to) {
            $queueItem = $this->queueItemFactory()->create(EmailQueueItem::class);

            $queueItem->setTo($to);
            $queueItem->setFrom($author);
            $queueItem->setSubject($subject);
            $queueItem->setMsgHtml($msgHtml);
            $queueItem->setMsgTxt($msgTxt);
            $queueItem->setCampaign($campaign);
            $queueItem->setProcessingDate($ts);
            $queueItem->setQueueId($queueId);

            $res = $queueItem->save();
        }

        return true;
    }
public function queue ( $ ts = null ) { $ recipients = $ this -> to ( ) ; $ author = $ this -> from ( ) ; $ subject = $ this -> subject ( ) ; $ msgHtml = $ this -> msgHtml ( ) ; $ msgTxt = $ this -> msgTxt ( ) ; $ campaign = $ this -> campaign ( ) ; $ queueId = $ this -> queueId ( ) ; foreach ( $ recipients as $ to ) { $ queueItem = $ this -> queueItemFactory ( ) -> create ( EmailQueueItem :: class ) ; $ queueItem -> setTo ( $ to ) ; $ queueItem -> setFrom ( $ author ) ; $ queueItem -> setSubject ( $ subject ) ; $ queueItem -> setMsgHtml ( $ msgHtml ) ; $ queueItem -> setMsgTxt ( $ msgTxt ) ; $ queueItem -> setCampaign ( $ campaign ) ; $ queueItem -> setProcessingDate ( $ ts ) ; $ queueItem -> setQueueId ( $ queueId ) ; $ res = $ queueItem -> save ( ) ; } return true ; }
Enqueue the email for each recipient.

@param mixed $ts A date/time to initiate the queue processing.
@return boolean Success / Failure.
Enqueue the email for each recipient .