当前位置: 首页>>代码示例>>PHP>>正文


PHP Message::setBody方法代码示例

本文整理汇总了PHP中Illuminate\Mail\Message::setBody方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::setBody方法的具体用法?PHP Message::setBody怎么用?PHP Message::setBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Mail\Message的用法示例。


在下文中一共展示了Message::setBody方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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');
     }
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:17,代码来源:Mailer.php

示例2: getIlluminateEmails

 /**
  * Builds the email array and return it as an array of all emails to be sent!!
  */
 public function getIlluminateEmails()
 {
     $emails = [];
     foreach ($this->tos as $destination) {
         $mail = new Message(new Swift_Message());
         $mail->to($destination[0], $destination[1]);
         $mail->from($this->from['email'], $this->from['name']);
         $mail->subject($this->subject);
         $mail->setBody($this->body['content'], $this->body['type']);
         foreach ($this->files as $file) {
             $mail->attach($file);
         }
         $emails[] = $mail;
     }
     return $emails;
 }
开发者ID:anekdotes,项目名称:mailer,代码行数:19,代码来源:MailTrapEmailAdapter.php

示例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)) {
         $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');
     }
 }
开发者ID:tamboer,项目名称:LaravelOctober,代码行数:26,代码来源:Mailer.php

示例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, $data)
 {
     if (isset($view)) {
         $message->setBody($this->getView($view, $data), 'text/html');
     }
     if (isset($plain)) {
         $message->addPart($this->getView($plain, $data), 'text/plain');
     }
 }
开发者ID:arifmahmudrana,项目名称:angularjs-laravel-boilerplate,代码行数:18,代码来源:Mailer.php

示例5: addContent

 /**
  * Add the content to a given message.
  *
  * @param  \Illuminate\Mail\Message  $message
  * @param  string  $view
  * @param  string  $plain
  * @param  string  $raw
  * @param  array  $data
  * @return void
  */
 protected function addContent($message, $view, $plain, $raw, $data)
 {
     if (isset($view)) {
         $message->setBody($this->getView($view, $data), 'text/html');
     }
     if (isset($plain)) {
         $method = isset($view) ? 'addPart' : 'setBody';
         $message->{$method}($this->getView($plain, $data), 'text/plain');
     }
     if (isset($raw)) {
         $method = isset($view) || isset($plain) ? 'addPart' : 'setBody';
         $message->{$method}($raw, 'text/plain');
     }
 }
开发者ID:bryanashley,项目名称:framework,代码行数:24,代码来源:Mailer.php

示例6: 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]);
 }
开发者ID:janusnic,项目名称:23copperleaf,代码行数:40,代码来源:Mailer.php


注:本文中的Illuminate\Mail\Message::setBody方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。