38 lines
948 B
PHP
38 lines
948 B
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Preventivo;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class PreventivoAdmin extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(public Preventivo $preventivo)
|
|
{
|
|
}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: 'Nuovo preventivo n. '.$this->preventivo->numero.' da '.($this->preventivo->cliente?->nominativo ?? 'cliente'),
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
markdown: 'emails.preventivo-admin',
|
|
with: [
|
|
'preventivo' => $this->preventivo,
|
|
'adminUrl' => rtrim(config('app.url'), '/').'/admin/preventivos/'.$this->preventivo->id,
|
|
],
|
|
);
|
|
}
|
|
}
|