本文整理汇总了PHP中Illuminate\Mail\Message::addPart方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::addPart方法的具体用法?PHP Message::addPart怎么用?PHP Message::addPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Mail\Message
的用法示例。
在下文中一共展示了Message::addPart方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addContent
/**
* Add the content to a given message.
*
* @param \Illuminate\Mail\Message $message
* @param string $view
* @param string $plain
* @param array $data
* @return void
*/
protected function addContent($message, $view, $plain, $data)
{
if (isset($view)) {
$viewContent = $this->getView($view, $data);
$result = MailParser::parse($viewContent);
$message->setBody($result['html'], 'text/html');
if ($result['text']) {
$message->addPart($result['text'], 'text/plain');
}
if ($subject = array_get($result['settings'], 'subject')) {
$message->subject($subject);
}
}
if (isset($plain)) {
$message->addPart($this->getView($plain, $data), 'text/plain');
}
}
示例2: addContentRaw
/**
* Add the raw content to a given message.
*
* @param \Illuminate\Mail\Message $message
* @param string $html
* @param string $text
* @return void
*/
protected function addContentRaw($message, $html, $text)
{
if (isset($html)) {
$message->setBody($html, 'text/html');
}
if (isset($text)) {
$message->addPart($text, 'text/plain');
}
}
示例3: addContent
/**
* Add the content to a given message.
*
* @param \Illuminate\Mail\Message $message
* @param string $view
* @param string $plain
* @param array $data
* @return void
*/
protected function addContent($message, $view, $plain, $data)
{
if (isset($view)) {
$message->setBody($this->getView($view, $data), 'text/html');
}
if (isset($plain)) {
$message->addPart($this->getView($plain, $data), 'text/plain');
}
}
示例4: addContent
/**
* Add the content to a given message.
*
* @param \Illuminate\Mail\Message $message
* @param string $view
* @param string $plain
* @param array $data
* @return void
*/
protected function addContent($message, $view, $plain, $raw, $data)
{
/*
* Extensbility
*/
if ($this->fireEvent('mailer.beforeAddContent', [$message, $view, $data], true) === false || Event::fire('mailer.beforeAddContent', [$this, $message, $view, $data], true) === false) {
return;
}
if (isset($view)) {
$viewContent = $this->getView($view, $data);
$result = MailParser::parse($viewContent);
$message->setBody($result['html'], 'text/html');
if ($result['text']) {
$message->addPart($result['text'], 'text/plain');
}
if ($subject = array_get($result['settings'], 'subject')) {
$message->subject($subject);
}
}
if (isset($plain)) {
$message->addPart($this->getView($plain, $data), 'text/plain');
}
if (isset($raw)) {
$message->addPart($raw, 'text/plain');
}
/*
* Extensbility
*/
$this->fireEvent('mailer.addContent', [$message, $view, $data]);
Event::fire('mailer.addContent', [$this, $message, $view, $data]);
}