Blame view

app/Mail/SendAllMessages.php 1.07 KB
e3c7b0ffb   Андрей Ларионов   Коммит на понедел...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  <?php
  
  namespace App\Mail;
  
  use App\Models\User;
  use Illuminate\Bus\Queueable;
  use Illuminate\Contracts\Queue\ShouldQueue;
  use Illuminate\Mail\Mailable;
  use Illuminate\Mail\Mailables\Address;
  use Illuminate\Mail\Mailables\Content;
  use Illuminate\Mail\Mailables\Envelope;
  use Illuminate\Queue\SerializesModels;
  
  class SendAllMessages extends Mailable
  {
      use Queueable, SerializesModels;
  
      protected $data;
  
      public function __construct($data)
      {
          $this->data = $data;
      }
  
      public function envelope(): Envelope
      {
          return new Envelope(
              from: new Address('jeffrey@example.com', 'Рассылка сообщений'),
              subject: 'Send add messages',
          );
      }
  
      public function content(): Content
      {
          return new Content(
              view: 'emails.send_workers',
          );
      }
  
      public function build()
      {
  
          // Вернуть все данные
          return $this->view('emails.send_workers', ['data' => $this->data]);
      }
  
  
      public function attachments(): array
      {
          return [];
      }
  }