Extract helper

This commit is contained in:
Marcus Moore 2025-01-30 10:37:11 -08:00
parent 6a4a5d1380
commit e94ee48f74
No known key found for this signature in database

View file

@ -58,15 +58,9 @@ class CheckoutAssetMail extends Mailable
{ {
$from = new Address(config('mail.from.address'), config('mail.from.name')); $from = new Address(config('mail.from.address'), config('mail.from.name'));
$subject = trans('mail.Asset_Checkout_Notification');
if (!$this->firstTimeSending) {
$subject = trans('mail.Asset_Checkout_Reminder_Notification');
}
return new Envelope( return new Envelope(
from: $from, from: $from,
subject: $subject, subject: $this->getSubject(),
); );
} }
@ -117,4 +111,13 @@ class CheckoutAssetMail extends Mailable
{ {
return []; return [];
} }
private function getSubject(): string
{
if ($this->firstTimeSending) {
return trans('mail.Asset_Checkout_Notification');
}
return trans('mail.Asset_Checkout_Reminder_Notification');
}
} }