本文整理汇总了PHP中CakeEmail::readReceipt方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeEmail::readReceipt方法的具体用法?PHP CakeEmail::readReceipt怎么用?PHP CakeEmail::readReceipt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeEmail
的用法示例。
在下文中一共展示了CakeEmail::readReceipt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例2: send
/**
* Send an email using the specified content, template and layout
*
* @param string|array $content Either an array of text lines, or a string with contents
* If you are rendering a template this variable will be sent to the templates as `$content`
* @param string $template Template to use when sending email
* @param string $layout Layout to use to enclose email body
* @return boolean Success
*/
public function send($content = null, $template = null, $layout = null) {
$lib = new CakeEmail();
$lib->charset = $this->charset;
$lib->headerCharset = $this->charset;
$lib->from($this->_formatAddresses((array)$this->from));
if (!empty($this->to)) {
$lib->to($this->_formatAddresses((array)$this->to));
}
if (!empty($this->cc)) {
$lib->cc($this->_formatAddresses((array)$this->cc));
}
if (!empty($this->bcc)) {
$lib->bcc($this->_formatAddresses((array)$this->bcc));
}
if (!empty($this->replyTo)) {
$lib->replyTo($this->_formatAddresses((array)$this->replyTo));
}
if (!empty($this->return)) {
$lib->returnPath($this->_formatAddresses((array)$this->return));
}
if (!empty($this->readReceipt)) {
$lib->readReceipt($this->_formatAddresses((array)$this->readReceipt));
}
$lib->subject($this->subject)->messageID($this->messageId);
$lib->helpers($this->_controller->helpers);
$headers = array('X-Mailer' => $this->xMailer);
foreach ($this->headers as $key => $value) {
$headers['X-' . $key] = $value;
}
if ($this->date) {
$headers['Date'] = $this->date;
}
$lib->setHeaders($headers);
if ($template) {
$this->template = $template;
}
if ($layout) {
$this->layout = $layout;
}
$lib->template($this->template, $this->layout)->viewVars($this->_controller->viewVars)->emailFormat($this->sendAs);
if (!empty($this->attachments)) {
$lib->attachments($this->_formatAttachFiles());
}
$lib->transport(ucfirst($this->delivery));
if ($this->delivery === 'mail') {
$lib->config(array('eol' => $this->lineFeed, 'additionalParameters' => $this->additionalParams));
} elseif ($this->delivery === 'smtp') {
$lib->config($this->smtpOptions);
} else {
$lib->config(array());
}
$sent = $lib->send($content);
$this->htmlMessage = $lib->message(CakeEmail::MESSAGE_HTML);
if (empty($this->htmlMessage)) {
$this->htmlMessage = null;
}
$this->textMessage = $lib->message(CakeEmail::MESSAGE_TEXT);
if (empty($this->textMessage)) {
$this->textMessage = null;
}
$this->_header = array();
$this->_message = array();
return $sent;
}