2024-12-24 15:12:24 +07:00
|
|
|
<?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;
|
2024-12-24 15:12:24 +07:00
|
|
|
|
|
|
|
|
class ExpenseApproved extends Mailable
|
|
|
|
|
{
|
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
protected string $name,
|
|
|
|
|
protected string $expense_number,
|
|
|
|
|
protected string $tanggal,
|
|
|
|
|
protected int $total,
|
2025-01-09 13:22:56 +07:00
|
|
|
protected string $url,
|
2024-12-24 15:12:24 +07:00
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
public function envelope(): Envelope
|
|
|
|
|
{
|
|
|
|
|
return new Envelope(
|
2025-01-16 15:56:22 +07:00
|
|
|
subject: 'Expense First Approval',
|
2024-12-24 15:12:24 +07:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function content(): Content
|
|
|
|
|
{
|
|
|
|
|
return new Content(
|
|
|
|
|
view: 'mail.approved',
|
|
|
|
|
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,
|
2024-12-24 15:12:24 +07:00
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function attachments(): array
|
|
|
|
|
{
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2025-03-05 13:44:58 +07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Render the Blade email template as HTML string (for Brevo API).
|
|
|
|
|
*/
|
|
|
|
|
public function renderHtml(): string
|
|
|
|
|
{
|
|
|
|
|
return View::make('mail.approved', [
|
|
|
|
|
'name' => $this->name,
|
|
|
|
|
'expense_number' => $this->expense_number,
|
|
|
|
|
'tanggal' => $this->tanggal,
|
|
|
|
|
'total' => $this->total,
|
|
|
|
|
'url' => $this->url,
|
|
|
|
|
])->render();
|
|
|
|
|
}
|
2024-12-24 15:12:24 +07:00
|
|
|
}
|