php中的Mandrill队列
你知道如何用PHP控制Mandrill发送电子邮件的队列吗? 我使用Symfony作为框架,这是我在Mandrill类中的send函数: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(),
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()
{
...
}