fixed target name for checkouts with licenses and assets

This commit is contained in:
Godfrey M
2025-08-07 15:12:23 -07:00
parent d91598a25e
commit e47972731b
4 changed files with 20 additions and 4 deletions
+9 -1
View File
@@ -2,6 +2,7 @@
namespace App\Mail;
use App\Models\Asset;
use App\Models\LicenseSeat;
use App\Models\Setting;
use App\Models\User;
@@ -25,9 +26,16 @@ class CheckoutLicenseMail extends Mailable
$this->item = $licenseSeat;
$this->admin = $checkedOutBy;
$this->note = $note;
$this->target = $checkedOutTo;
$this->acceptance = $acceptance;
$this->settings = Setting::getSettings();
$this->target = $checkedOutTo;
if($this->target instanceof User){
$this->target = $this->target->present()->fullName();
}
elseif($this->target instanceof Asset){
$this->target = $this->target->assignedto->present()->fullName();
}
}
/**