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


PHP Message::replyTo方法代码示例

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


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

示例1: addressMessage

 /**
  * Address the mail message.
  *
  * @param  \Illuminate\Mail\Message  $mailMessage
  * @param  mixed  $notifiable
  * @param  \Illuminate\Notifications\Messages\MailMessage  $message
  * @return void
  */
 protected function addressMessage($mailMessage, $notifiable, $message)
 {
     $recipients = empty($message->to) ? $notifiable->routeNotificationFor('mail') : $message->to;
     if (!empty($message->from)) {
         $mailMessage->from($message->from[0], isset($message->from[1]) ? $message->from[1] : null);
     }
     if (is_array($recipients)) {
         $mailMessage->bcc($recipients);
     } else {
         $mailMessage->to($recipients);
     }
     if ($message->cc) {
         $mailMessage->cc($message->cc);
     }
     if (!empty($message->replyTo)) {
         $mailMessage->replyTo($message->replyTo[0], isset($message->replyTo[1]) ? $message->replyTo[1] : null);
     }
 }
开发者ID:jarnovanleeuwen,项目名称:framework,代码行数:26,代码来源:MailChannel.php

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