MassSendingMessages.php 923 Bytes
<?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 MassSendingMessages extends Mailable
{
    use Queueable, SerializesModels;

    protected $data;

    public function __construct($data)
    {
        $this->data = $data;
    }

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Запрос на рассылку сообщений',
        );
    }

    public function build()
    {

        // Вернуть все данные
        return $this->view('emails.added_mass_sending_messages', ['data' => $this->data]);
    }


    public function attachments(): array
    {
        return [];
    }
}