123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Mail;
- use Illuminate\Bus\Queueable;
- use Illuminate\Mail\Mailable;
- use Illuminate\Queue\SerializesModels;
- class NoticeMail extends Mailable
- {
- use Queueable, SerializesModels;
- protected $body = [];
- protected $title = [];
- /**
- * 创建一个新消息实例。
- *
- * @return void
- */
- public function __construct($title, $body)
- {
- $this->title = $title;
- $this->body = $body;
- }
- /**
- * 构建消息。
- *
- * @return $this
- */
- public function build()
- {
- return $this->view('emails.information')->subject($this->title)->with(['body' => $this->body]);
- }
- }
|