Skip to content

Commit aa014e3

Browse files
committed
Improve wording
1 parent cd36788 commit aa014e3

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

app/Mail/BulkAssetCheckoutMail.php

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public function content(): Content
4646
markdown: 'mail.markdown.bulk-asset-checkout-mail',
4747
with: [
4848
'introduction' => $this->getIntroduction(),
49-
'requires_acceptance' => $this->requiresAcceptance(),
49+
'requires_acceptance' => $this->requires_acceptance,
50+
'requires_acceptance_wording' => $this->getRequiresAcceptanceWording(),
5051
'acceptance_url' => $this->acceptanceUrl(),
5152
'eula' => $this->getEula(),
5253
],
@@ -70,7 +71,12 @@ private function getSubject(): string
7071

7172
private function getIntroduction(): string
7273
{
73-
if ($this->target instanceof Location && $this->assets->count() > 1) {
74+
if ($this->target instanceof Location) {
75+
if ($this->assets->count() === 1) {
76+
// @todo: translate
77+
return "An asset have been checked out to {$this->target->name}.";
78+
}
79+
7480
// @todo: translate
7581
return "Assets have been checked out to {$this->target->name}.";
7682
}
@@ -129,4 +135,25 @@ private function requiresAcceptance(): bool
129135
fn($count, $asset) => $count + $asset->requireAcceptance()
130136
);
131137
}
138+
139+
private function getRequiresAcceptanceWording(): array
140+
{
141+
if (!$this->requiresAcceptance()) {
142+
return [];
143+
}
144+
145+
if ($this->assets->count() > 1) {
146+
return [
147+
// todo: translate
148+
'One or more items require acceptance.',
149+
"**[✔ Click here to review the terms of use and accept the items]({$this->acceptanceUrl()})**",
150+
];
151+
}
152+
153+
return [
154+
// todo: translate
155+
'The checked out item requires acceptance.',
156+
"**[✔ Click here to review the terms of use and accept the item]({$this->acceptanceUrl()})**",
157+
];
158+
}
132159
}

resources/views/mail/markdown/bulk-asset-checkout-mail.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
{{ $introduction }}
1818

1919
@if ($requires_acceptance)
20-
One or more items require acceptance.<br>
21-
**[✔ Click here to review the terms of use and accept the items]({{ $acceptance_url }})**
20+
@foreach($requires_acceptance_wording as $line)
21+
{{ $line }}<br>
22+
@endforeach
2223
@endif
2324

2425
<hr>

0 commit comments

Comments
 (0)