Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php中的Mandrill队列_Php_Symfony_Message Queue_Mandrill - Fatal编程技术网

php中的Mandrill队列

php中的Mandrill队列,php,symfony,message-queue,mandrill,Php,Symfony,Message Queue,Mandrill,你知道如何用PHP控制Mandrill发送电子邮件的队列吗? 我使用Symfony作为框架,这是我在Mandrill类中的send函数: public function sendMandrill() { $listTo = array(); foreach ($this->contacts as $contact) { $listTo[] = [ 'name' => $contact->getFname(),

你知道如何用PHP控制Mandrill发送电子邮件的队列吗? 我使用Symfony作为框架,这是我在Mandrill类中的send函数:

public function sendMandrill()
{
    $listTo = array();
    foreach ($this->contacts as $contact)
    {
        $listTo[] = [
            'name' => $contact->getFname(),
            'email' => $contact->getEmail()
        ];
    }
    var_dump($listTo);


    $email = array(
        'html' => $this->message->getBodyHtml(),
        'text' => $this->message->getBodyText(),
        'subject' => $this->message->getSubject(),
        'from_email' => $this->apiDom,
        'from_name' => $this->message->getFromName(),
        'to' => $listTo,
        "preserve_recipients"=> false,
    );

    $this->senderAPI = new \Mandrill("$this->apiKey");

    return $this->senderAPI->messages->send($email);

}
现在,我想创建一个函数,这样我就可以暂停发送一段时间,这样我就可以更改这些内容,然后随时恢复发送,或者可能会停止发送! 这意味着将有3个功能,如下所示:

public function pauseMandrill()
    {
               ...
    }

    public function resumeMandrill()
    {
               ...
    }

    public function stopMandrill()
    {
               ...
    }