MailRepair.php 1.09 KB
<?php

namespace App\Mail;

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 MailRepair extends Mailable
{
    use Queueable, SerializesModels;

    protected $new_password;

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

    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.RepairPassword',
        );
    }

    public function build()
    {

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


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