Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/Http/Controllers/Account/AcceptanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ public function store(Request $request, $id) : RedirectResponse

// Add the attachment for the signing user into the $data array
$data['file'] = $pdf_filename;

$locale = $assigned_user->locale;
try {
$assigned_user->notify(new AcceptanceAssetAcceptedToUserNotification($data));
$assigned_user->notify((new AcceptanceAssetAcceptedToUserNotification($data))->locale($locale));
} catch (\Exception $e) {
Log::warning($e);
}
}
try {
$acceptance->notify(new AcceptanceAssetAcceptedNotification($data));
$acceptance->notify((new AcceptanceAssetAcceptedNotification($data))->locale(Setting::getSettings()->locale));
} catch (\Exception $e) {
Log::warning($e);
}
Expand Down
6 changes: 4 additions & 2 deletions app/Listeners/CheckoutableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public function onCheckedOut($event)

if (!empty($to)) {
try {
Mail::to(array_flatten($to))->cc(array_flatten($cc))->send($mailable);
Mail::to(array_flatten($to))->send($mailable->locale($notifiable->locale));
Mail::to(array_flatten($cc))->send($mailable->locale(Setting::getSettings()->locale));
Log::info('Checkout Mail sent to checkout target');
} catch (ClientException $e) {
Log::debug("Exception caught during checkout email: " . $e->getMessage());
Expand Down Expand Up @@ -180,7 +181,8 @@ public function onCheckedIn($event)

try {
if (!empty($to)) {
Mail::to(array_flatten($to))->cc(array_flatten($cc))->send($mailable);
Mail::to(array_flatten($to))->send($mailable->locale($notifiable->locale));
Mail::to(array_flatten($cc))->send($mailable->locale(Setting::getSettings()->locale));
Log::info('Checkin Mail sent to CC addresses');
}
} catch (ClientException $e) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Checkouts/Ui/BulkAssetCheckoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testCanBulkCheckoutAssets()
$this->assertHasTheseActionLogs($asset, ['create', 'checkout']); //Note: '$this' gets auto-bound in closures, so this does work.
});

Mail::assertSent(CheckoutAssetMail::class, 2);
Mail::assertSent(CheckoutAssetMail::class, 4);
Mail::assertSent(CheckoutAssetMail::class, function (CheckoutAssetMail $mail) {
return $mail->hasTo('someone@example.com');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ public function test_admin_alert_email_sends()

$this->fireCheckInEvent($this->asset, $this->user);

Mail::assertSentCount(2);
Mail::assertSent(CheckinAssetMail::class, function ($mail) {
return $mail->hasTo($this->user->email) && $mail->hasCc('cc@example.com');
return $mail->hasTo($this->user->email);
});
Mail::assertSent(CheckinAssetMail::class, function ($mail) {
return $mail->hasTo('cc@example.com');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function test_admin_alert_email_sends()
$this->fireCheckoutEvent();

Mail::assertSent(CheckoutAssetMail::class, function (CheckoutAssetMail $mail) {
return $mail->hasCc('cc@example.com');
return $mail->hasTo('cc@example.com');
});
}

Expand Down
Loading