Files
expense/app/Mail/ExpenseRejected.php
T

85 lines
2.0 KiB
PHP
Raw Normal View History

<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
2025-03-05 13:44:58 +07:00
use Illuminate\Support\Facades\View;
class ExpenseRejected extends Mailable
{
use Queueable, SerializesModels;
2025-03-05 13:44:58 +07:00
protected string $name;
protected string $expense_number;
protected string $tanggal;
protected int $total;
protected string $url;
/**
* Create a new message instance.
*/
2025-03-05 13:44:58 +07:00
public function __construct(string $name, string $expense_number, string $tanggal, int $total, string $url)
{
$this->name = $name;
$this->expense_number = $expense_number;
$this->tanggal = $tanggal;
$this->total = $total;
$this->url = $url;
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Expense Rejected',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'mail.rejected',
with: [
'name' => $this->name,
'expense_number' => $this->expense_number,
'tanggal' => $this->tanggal,
'total' => $this->total,
2025-01-09 13:22:56 +07:00
'url' => $this->url,
],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
2025-03-05 13:44:58 +07:00
/**
* Render the Blade email template as an HTML string (for Brevo API).
*/
public function renderHtml(): string
{
return View::make('mail.rejected', [
'name' => $this->name,
'expense_number' => $this->expense_number,
'tanggal' => $this->tanggal,
'total' => $this->total,
'url' => $this->url,
])->render();
}
}