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


PHP Message::subject方法代码示例

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


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

示例1: 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

示例2: 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

示例3: sendClosure

 protected function sendClosure(Message $mailObject)
 {
     $mailObject->subject($this->subject);
     $mailObject->from($this->from[0]['address'], $this->from[0]['name']);
     foreach ($this->to as $toDetails) {
         $mailObject->to($toDetails['address'], $toDetails['name']);
     }
     foreach ($this->cc as $ccDetails) {
         $mailObject->cc($ccDetails['address'], $ccDetails['name']);
     }
     foreach ($this->bcc as $bccDetails) {
         $mailObject->bcc($bccDetails['address'], $bccDetails['name']);
     }
     foreach ($this->attachments as $attachmentDetails) {
         $mailObject->attach($attachmentDetails['file'], ['as' => $attachmentDetails['filename'], 'mime' => $attachmentDetails['mimetype']]);
     }
 }
开发者ID:vultuk,项目名称:MailAwesome,代码行数:17,代码来源:MailAwesome.php

示例4: buildSubject

 /**
  * Set the subject for the message.
  *
  * @param  \Illuminate\Mail\Message  $message
  * @return $this
  */
 protected function buildSubject($message)
 {
     if ($this->subject) {
         $message->subject($this->subject);
     } else {
         $message->subject(Str::title(Str::snake(class_basename($this), ' ')));
     }
     return $this;
 }
开发者ID:scrubmx,项目名称:framework,代码行数:15,代码来源:Mailable.php

示例5: 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)
 {
     /*
      * Extensibility
      */
     if ($this->fireEvent('mailer.beforeAddContent', [$message, $view, $data], true) === false || Event::fire('mailer.beforeAddContent', [$this, $message, $view, $data], true) === false) {
         return;
     }
     $html = null;
     $text = null;
     if (isset($view)) {
         $viewContent = $this->getView($view, $data);
         $result = MailParser::parse($viewContent);
         $html = $result['html'];
         if ($result['text']) {
             $text = $result['text'];
         }
         /*
          * Subject
          */
         $customSubject = $message->getSwiftMessage()->getSubject();
         if (empty($customSubject) && ($subject = array_get($result['settings'], 'subject'))) {
             $message->subject($subject);
         }
     }
     if (isset($plain)) {
         $text = $this->getView($plain, $data);
     }
     if (isset($raw)) {
         $text = $raw;
     }
     $this->addContentRaw($message, $html, $text);
     /*
      * Extensibility
      */
     $this->fireEvent('mailer.addContent', [$message, $view, $data]);
     Event::fire('mailer.addContent', [$this, $message, $view, $data]);
 }
开发者ID:nevinsm,项目名称:personalSite,代码行数:47,代码来源:Mailer.php

示例6: recuperaAccesoMessage

 /**
  * CLOUSURE.
  *
  * Éste metodo es invocado desde la función Password::remind():
  *
  * Establece el asunto del mensaje que será enviado al usuario despúes de
  * solicitar la recuperación de su contraseña de acceso.
  *
  * @access protected
  * @param  Illuminate\Mail\Message  $message
  * @return void
  */
 protected function recuperaAccesoMessage(\Illuminate\Mail\Message $message)
 {
     $message->subject('Restaura tu contraseña de acceso.');
 }
开发者ID:egalink,项目名称:proveedores,代码行数:16,代码来源:UsuarioController.php

示例7: setSubject

 /**
  * Sets tzhe subject of the message
  *
  * @param \Illuminate\Mail\Message $message
  * @return void
  **/
 protected function setSubject(Message $message)
 {
     if (!isset($this->data['subject'])) {
         throw new OutOfBoundsException("You have to pass a subject key and value in your view data");
     }
     $message->subject($this->data['subject']);
 }
开发者ID:realholgi,项目名称:cmsable,代码行数:13,代码来源:MessageBuilder.php

示例8: 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

示例9: generateMessage

 /**
  * Generates a \Illuminate\Mail\Message template ready to send
  *
  * @param array $args = []
  * @return $this
  */
 public function generateMessage($args = [])
 {
     if (!empty($args)) {
         foreach ($args as $att => $v) {
             if (array_key_exists($att, get_object_vars($this))) {
                 $this->{$att} = $v;
             }
         }
     }
     $msg = new Message(new \Swift_Message());
     if ($this->hasFrom()) {
         $from = $this->getFrom();
         $msg->from($from[0], $from[1]);
     }
     if ($this->hasSender()) {
         $sender = $this->getSender();
         $msg->sender($sender[0], $sender[1]);
     }
     if ($this->hasTo()) {
         $to = $this->getTo();
         $msg->to($to[0], $to[1]);
     }
     if ($this->hasCc()) {
         $cc = $this->getCc();
         $msg->cc($cc[0], $cc[1]);
     }
     if ($this->hasBcc()) {
         $bcc = $this->getBcc();
         $msg->bcc($bcc[0], $bcc[1]);
     }
     if ($this->hasReplyTo()) {
         $reply_to = $this->getReplyTo();
         $msg->replyTo($reply_to[0], $reply_to[1]);
     }
     if ($this->hasSubject()) {
         $msg->subject($this->getSubject());
     }
     if ($this->hasAttach()) {
         foreach ($this->getAttach() as $attach) {
             $msg->attachData($attach[0], $attach[1], $attach[2]);
         }
     }
     if ($this->hasPriority()) {
         $msg->priority($this->getPriority());
     }
     $this->setMessage($msg);
     return $this;
 }
开发者ID:frenchfrogs,项目名称:mail,代码行数:54,代码来源:Mail.php


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