本文整理汇总了PHP中Swift_Mime_Message::getSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Swift_Mime_Message::getSubject方法的具体用法?PHP Swift_Mime_Message::getSubject怎么用?PHP Swift_Mime_Message::getSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Swift_Mime_Message
的用法示例。
在下文中一共展示了Swift_Mime_Message::getSubject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _logSendError
/**
* @param Swift_Mime_Message $message
* @param array|null $failedRecipients
* @param Exception|null $exception
*/
protected function _logSendError(Swift_Mime_Message $message, array $failedRecipients = null, Exception $exception = null)
{
$context = new CM_Log_Context();
$context->setExtra(['message' => ['subject' => $message->getSubject(), 'from' => $message->getFrom(), 'to' => $message->getTo(), 'cc' => $message->getCc(), 'bcc' => $message->getBcc()], 'failedRecipients' => $failedRecipients]);
if ($exception) {
$context->setException($exception);
}
$this->getServiceManager()->getLogger()->error('Failed to send email', $context);
}
示例2: send
public function send(Swift_Mime_Message $message, &$failedRecipients = null)
{
$failedRecipients = (array) $failedRecipients;
$msg = '* ' . $message->getSubject() . ' *' . PHP_EOL . PHP_EOL;
if ($message instanceof CM_Mail_Message) {
$msg .= $message->getText() . PHP_EOL;
} else {
$msg .= $message->getBody() . PHP_EOL;
}
$logger = $this->getLogger();
$context = new CM_Log_Context();
$context->setExtra(['type' => CM_Paging_Log_Mail::getTypeStatic(), 'sender' => $message->getSender(), 'replyTo' => $message->getReplyTo(), 'to' => $message->getTo(), 'cc' => $message->getCc(), 'bcc' => $message->getBcc()]);
$logger->addMessage($msg, $this->_logLevel, $context);
return count($message->getTo()) + count($message->getCc()) + count($message->getBcc());
}
示例3: info
/**
* Generate a human readable HTML comment with message info.
*
* @return string
*/
private function info()
{
return sprintf("<!--\nFrom:%s, \nTo:%s, \nReply-to:%s, \nCC:%s, \nBCC:%s, \nSubject:%s\n-->\n", json_encode($this->message->getFrom()), json_encode($this->message->getTo()), json_encode($this->message->getReplyTo()), json_encode($this->message->getCc()), json_encode($this->message->getBcc()), $this->message->getSubject());
}