mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Only send mail to target if they have an email address
This commit is contained in:
@@ -19,17 +19,17 @@ class CheckoutablesCheckedOutInBulkListener
|
||||
|
||||
public function handle(CheckoutablesCheckedOutInBulk $event): void
|
||||
{
|
||||
// @todo: only send if user has email address
|
||||
Mail::to($event->target)->send(new BulkAssetCheckoutMail(
|
||||
$event->assets,
|
||||
$event->target,
|
||||
$event->admin,
|
||||
$event->checkout_at,
|
||||
$event->expected_checkin,
|
||||
$event->note,
|
||||
));
|
||||
if ($event->target->email) {
|
||||
Mail::to($event->target)->send(new BulkAssetCheckoutMail(
|
||||
$event->assets,
|
||||
$event->target,
|
||||
$event->admin,
|
||||
$event->checkout_at,
|
||||
$event->expected_checkin,
|
||||
$event->note,
|
||||
));
|
||||
}
|
||||
|
||||
// @todo: create and attach acceptance? Might be handled in CheckoutableListener::getCheckoutAcceptance() already.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,6 @@ class BulkCheckoutEmailTest extends TestCase
|
||||
|
||||
public function test_email_is_not_sent_when_user_does_not_have_email_address()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
|
||||
$this->settings->disableAdminCC();
|
||||
|
||||
$this->target = User::factory()->create(['email' => null]);
|
||||
|
||||
Reference in New Issue
Block a user