Skip to content

A free open source IT asset/license management system

Extract helper

Marcus Mooree94ee48f7418
diff --git a/app/Mail/CheckoutAssetMail.php b/app/Mail/CheckoutAssetMail.php
index d6ce123d40..eb9619217f 100644
--- a/app/Mail/CheckoutAssetMail.php
+++ b/app/Mail/CheckoutAssetMail.php
@@ -58,15 +58,9 @@ class CheckoutAssetMail extends Mailable
{
$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(
from: $from,
- subject: $subject,
+ subject: $this->getSubject(),
);
}
@@ -117,4 +111,13 @@ class CheckoutAssetMail extends Mailable
{
return [];
}
+
+ private function getSubject(): string
+ {
+ if ($this->firstTimeSending) {
+ return trans('mail.Asset_Checkout_Notification');
+ }
+
+ return trans('mail.Asset_Checkout_Reminder_Notification');
+ }
}