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 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;
|
2025-10-26 14:14:06 +07:00
|
|
|
protected ?string $remarks;
|
2025-03-05 13:44:58 +07:00
|
|
|
|
2024-12-24 15:12:24 +07:00
|
|
|
/**
|
|
|
|
|
* Create a new message instance.
|
|
|
|
|
*/
|
2025-10-26 14:14:06 +07:00
|
|
|
public function __construct(string $name, string $expense_number, string $tanggal, int $total, string $url, ?string $remarks = null)
|
2025-03-05 13:44:58 +07:00
|
|
|
{
|
|
|
|
|
$this->name = $name;
|
|
|
|
|
$this->expense_number = $expense_number;
|
|
|
|
|
$this->tanggal = $tanggal;
|
|
|
|
|
$this->total = $total;
|
|
|
|
|
$this->url = $url;
|
2025-10-26 14:14:06 +07:00
|
|
|
$this->remarks = $remarks;
|
2025-03-05 13:44:58 +07:00
|
|
|
}
|
2024-12-24 15:12:24 +07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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,
|
2025-10-26 14:14:06 +07:00
|
|
|
'remarks' => $this->remarks,
|
2024-12-24 15:12:24 +07:00
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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,
|
2025-10-26 14:14:06 +07:00
|
|
|
'remarks' => $this->remarks,
|
2025-03-05 13:44:58 +07:00
|
|
|
])->render();
|
|
|
|
|
}
|
2024-12-24 15:12:24 +07:00
|
|
|
}
|