Skip to content

A free open source IT asset/license management system

Fix intro line to locations

Marcus Moorecd3678841b26
diff --git a/app/Mail/BulkAssetCheckoutMail.php b/app/Mail/BulkAssetCheckoutMail.php
index 876c4edca4..45644c6a2e 100644
--- a/app/Mail/BulkAssetCheckoutMail.php
+++ b/app/Mail/BulkAssetCheckoutMail.php
@@ -4,6 +4,7 @@ namespace App\Mail;
use App\Models\Asset;
use App\Models\CustomField;
+use App\Models\Location;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Database\Eloquent\Model;
@@ -69,6 +70,11 @@ class BulkAssetCheckoutMail extends Mailable
private function getIntroduction(): string
{
+ if ($this->target instanceof Location && $this->assets->count() > 1) {
+ // @todo: translate
+ return "Assets have been checked out to {$this->target->name}.";
+ }
+
if ($this->assets->count() > 1) {
// @todo: translate
return 'Assets have been checked out to you.';
diff --git a/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php b/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php
index 79c0f4e5a3..e38e19612e 100644
--- a/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php
+++ b/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php
@@ -63,7 +63,7 @@ class BulkCheckoutEmailTest extends TestCase
Mail::assertSent(BulkAssetCheckoutMail::class, function (BulkAssetCheckoutMail $mail) use ($manager) {
return $mail->hasTo($manager->email)
- && $mail->assertSeeInText('items have been checked out to ' . $this->target->name);
+ && $mail->assertSeeInText('Assets have been checked out to ' . $this->target->name);
});
}