當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。