本文整理汇总了PHP中CakeEmail::messageId方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeEmail::messageId方法的具体用法?PHP CakeEmail::messageId怎么用?PHP CakeEmail::messageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeEmail
的用法示例。
在下文中一共展示了CakeEmail::messageId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* Send
*
* A bit of a misnomer, because this actually just adds it to a CakeResque
* queue. The actual sending of the email will be performed later by a worker.
*
* @params CakeEmail $email
* @return array
*/
public function send(CakeEmail $email)
{
// Take a copy of the existing configuration.
$config = array('headers' => $email->getHeaders(), 'from' => $email->from(), 'sender' => $email->sender(), 'replyTo' => $email->replyTo(), 'readReceipt' => $email->readReceipt(), 'returnPath' => $email->returnPath(), 'to' => $email->to(), 'cc' => $email->cc(), 'bcc' => $email->bcc(), 'subject' => $email->subject(), 'viewRender' => $email->viewRender(), 'viewVars' => $email->viewVars(), 'emailFormat' => $email->emailFormat(), 'messageId' => $email->messageId(), 'attachments' => $email->attachments());
// unset($config['config']['transport']);
$template = $email->template();
$config['template'] = $template['template'];
$config['layout'] = $template['layout'];
// Clean it up to avoid errors.
$config = array_filter($config, function ($v) {
return (bool) $v;
});
debug($config);
// Include a message, if they sent one via plain text.
$message = $email->message(CakeEmail::MESSAGE_HTML) ? null : $email->message(CakeEmail::MESSAGE_TEXT);
// Drop it in a queue.
Resque::enqueue('email', 'ResqueEmail.EmailShell', array('send', $config, $message));
return array('headers' => $email->getHeaders(), 'message' => $email->message());
}