Skip to content

Commit 6811ebc

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 4fe7bfb + 7f9939a commit 6811ebc

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

app/Mail/CheckinAssetMail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function envelope(): Envelope
4747

4848
return new Envelope(
4949
from: $from,
50-
subject: trans('mail.Asset_Checkin_Notification'),
50+
subject: trans('mail.Asset_Checkin_Notification', ['tag' => $this->item->asset_tag]),
5151
);
5252
}
5353

app/Mail/CheckoutAssetMail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function attachments(): array
125125
private function getSubject(): string
126126
{
127127
if ($this->firstTimeSending) {
128-
return trans('mail.Asset_Checkout_Notification');
128+
return trans('mail.Asset_Checkout_Notification', ['tag' => $this->item->asset_tag]);
129129
}
130130

131131
return trans('mail.unaccepted_asset_reminder');

resources/lang/en-US/mail.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
'Accessory_Checkin_Notification' => 'Accessory checked in',
66
'Accessory_Checkout_Notification' => 'Accessory checked out',
7-
'Asset_Checkin_Notification' => 'Asset checked in',
8-
'Asset_Checkout_Notification' => 'Asset checked out',
7+
'Asset_Checkin_Notification' => 'Asset checked in: [:tag]',
8+
'Asset_Checkout_Notification' => 'Asset checked out: [:tag]',
99
'Confirm_Accessory_Checkin' => 'Accessory checkin confirmation',
1010
'Confirm_Asset_Checkin' => 'Asset checkin confirmation',
1111
'Confirm_component_checkin' => 'Component checkin confirmation',

tests/Unit/Mail/CheckoutAssetMailTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ function () {
2020
'asset' => $asset,
2121
'acceptance' => CheckoutAcceptance::factory()->for($asset, 'checkoutable')->create(),
2222
'first_time_sending' => true,
23-
'expected_subject' => 'Asset checked out',
23+
'expected_subject' => trans('mail.Asset_Checkout_Notification', ['tag' => $asset->asset_tag]),
2424
'expected_opening' => 'A new item has been checked out under your name that requires acceptance, details are below.'
2525
];
2626
}
2727
];
2828

2929
yield 'Asset not requiring acceptance' => [
3030
function () {
31+
$asset = Asset::factory()->doesNotRequireAcceptance()->create();
3132
return [
32-
'asset' => Asset::factory()->doesNotRequireAcceptance()->create(),
33+
'asset' => $asset,
3334
'acceptance' => null,
3435
'first_time_sending' => true,
35-
'expected_subject' => 'Asset checked out',
36+
'expected_subject' => trans('mail.Asset_Checkout_Notification', ['tag' => $asset->asset_tag]),
3637
'expected_opening' => 'A new item has been checked out under your name, details are below.'
3738
];
3839
}

tests/Unit/NotificationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA()
3131

3232
Mail::fake();
3333
$asset->checkOut($user, $admin->id);
34-
Mail::assertSent(CheckoutAssetMail::class, function (CheckoutAssetMail $mail) use ($user) {
35-
return $mail->hasTo($user->email) && $mail->hasSubject(trans('mail.Asset_Checkout_Notification'));
34+
Mail::assertSent(CheckoutAssetMail::class, function (CheckoutAssetMail $mail) use ($user, $asset) {
35+
return $mail->hasTo($user->email) && $mail->hasSubject(trans('mail.Asset_Checkout_Notification', ['tag' => $asset->asset_tag]));
3636
});
3737
}
3838
public function testDefaultEulaIsSentWhenSetInCategory()

0 commit comments

Comments
 (0)