mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
fixes expected checkin Notification
This commit is contained in:
@@ -50,7 +50,12 @@ class ExpectedCheckinNotification extends Notification
|
||||
*/
|
||||
public function toMail()
|
||||
{
|
||||
$today = Carbon::now();
|
||||
$today = Carbon::today();
|
||||
$expected = Carbon::parse($this->params->expected_checkin)->startOfDay();
|
||||
|
||||
$subjectText = $today->greaterThan($expected)
|
||||
? trans('mail.Expected_Checkin_Notification_Pastdue', ['name' => $this->params->display_name])
|
||||
: trans('mail.Expected_Checkin_Notification', ['name' => $this->params->display_name]);
|
||||
|
||||
$message = (new MailMessage)->markdown('notifications.markdown.expected-checkin',
|
||||
[
|
||||
@@ -60,7 +65,7 @@ class ExpectedCheckinNotification extends Notification
|
||||
'serial' => $this->params->serial,
|
||||
'asset_tag' => $this->params->asset_tag,
|
||||
])
|
||||
->subject('⏰'. ($today > $this->params->expected_checkin) ? trans('mail.Expected_Checkin_Notification_Pastdue', ['name' => $this->params->display_name]) : trans('mail.Expected_Checkin_Notification', ['name' => $this->params->display_name]))
|
||||
->subject('⏰'. $subjectText)
|
||||
->withSymfonyMessage(function (Email $message) {
|
||||
$message->getHeaders()->addTextHeader(
|
||||
'X-System-Sender', 'Snipe-IT'
|
||||
|
||||
Reference in New Issue
Block a user