Skip to content

A free open source IT asset/license management system

Make subject dynamic

Marcus Mooree2f4a9bf9f4f
diff --git a/app/Mail/BulkAssetCheckoutMail.php b/app/Mail/BulkAssetCheckoutMail.php
index 809dff5cfd..3b9038237e 100644
--- a/app/Mail/BulkAssetCheckoutMail.php
+++ b/app/Mail/BulkAssetCheckoutMail.php
@@ -30,8 +30,7 @@ class BulkAssetCheckoutMail extends Mailable
public function envelope(): Envelope
{
return new Envelope(
- // @todo: translate
- subject: 'Bulk Asset Checkout Mail',
+ subject: $this->getSubject(),
);
}
@@ -52,6 +51,17 @@ class BulkAssetCheckoutMail extends Mailable
return [];
}
+ private function getSubject(): string
+ {
+ if ($this->assets->count() > 1) {
+ // @todo: translate
+ return 'Assets checked out';
+ }
+
+ // @todo: translate
+ return trans('mail.Asset_Checkout_Notification', ['tag' => $this->assets->first()->asset_tag]);
+ }
+
private function getIntroduction(): string
{
// @todo: