update
This commit is contained in:
@@ -2,40 +2,27 @@
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Mail\Concerns\RequiresDbTemplate;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ExpiryService extends Mailable
|
||||
class ExpiryService extends TemplateMailable
|
||||
{
|
||||
use Queueable, SerializesModels, RequiresDbTemplate;
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/** @param int $template Không còn dùng — scenario cố định 'service_expiry'. Giữ tham số để không phá vỡ caller hiện tại. */
|
||||
public function __construct($template = 0, public $data = []) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: $this->renderFromTemplate('service_expiry', $this->vars())['subject'],
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
htmlString: $this->renderFromTemplate('service_expiry', $this->vars())['html'],
|
||||
);
|
||||
}
|
||||
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function vars(): array
|
||||
protected function scenario(): string
|
||||
{
|
||||
return 'service_expiry';
|
||||
}
|
||||
|
||||
protected function variables(): array
|
||||
{
|
||||
return [
|
||||
'company_name' => $this->data['company_name'] ?? '',
|
||||
|
||||
Reference in New Issue
Block a user