Fix Delist warning date on subject line of messages

This commit is contained in:
Deon George 2025-03-17 14:53:59 +11:00
parent db34b2b641
commit bbc013a7a0
2 changed files with 6 additions and 4 deletions

View File

@ -42,10 +42,11 @@ class NodeMarkedDown extends Notification //implements ShouldQueue
Log::info(sprintf('%s:+ Sending a NODE MARKED DOWN EMAIL for address [%s]',self::LOGKEY,$this->ao->ftn));
$now = Carbon::now();
$delist = $now->addDays(7);
return (new MailMessage)
->cc(our_address($this->ao)->system->users->first()->email)
->subject(sprintf('ACTION REQUIRED: Your system will be delisted on %s',$now->format('Y-m-d')))
->subject(sprintf('ACTION REQUIRED: Your system will be delisted on %s',$delist->format('Y-m-d')))
->line(sprintf('Your system has been marked **DOWN**, because it hasnt polled **%s** with address %s since **%s** (%d days).',
$this->ao->zone->domain->name,
$this->ao->ftn4d,
@ -57,7 +58,7 @@ class NodeMarkedDown extends Notification //implements ShouldQueue
->line(sprintf('* %s Echomails',number_format($this->ao->echomailWaiting()->count())))
->line(sprintf('* %s Files',number_format($this->ao->filesWaiting()->count())))
->line('')
->line(sprintf('Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**',$now->addDays(7)->format('Y-m-d')))
->line(sprintf('Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**',$delist->format('Y-m-d')))
->line('If you think you\'ve received this email by mistake or need help, please let me know.');
}
}

View File

@ -32,11 +32,12 @@ class NodeMarkedDown extends Netmails //implements ShouldQueue
{
$now = Carbon::now();
$ao = $notifiable->routeNotificationFor(static::via);
$delist = $now->addDays(7);
Log::info(sprintf('%s:+ Sending a NODE MARKED DOWN NETMAIL for address [%s]',self::LOGKEY,$ao->ftn));
$o = $this->setupNetmail($notifiable);
$o->subject = sprintf('ACTION REQUIRED: Your system will be delisted on %s',$now->format('Y-m-d'));
$o->subject = sprintf('ACTION REQUIRED: Your system will be delisted on %s',$delist->format('Y-m-d'));
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
// Message
@ -50,7 +51,7 @@ class NodeMarkedDown extends Netmails //implements ShouldQueue
->addText(sprintf("* %s Echomails\r",number_format($this->ao->echomailWaiting()->count())))
->addText(sprintf("* %s Files\r",number_format($this->ao->filesWaiting()->count())))
->addText("\r")
->addText(sprintf("Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**\r\r",$now->addDays(7)->format('Y-m-d')))
->addText(sprintf("Your system will automatically be **DE-LISTED** if your system hasnt polled to collected your mail/file(s) by **%s**\r\r",$delist->format('Y-m-d')))
->addText("If you think you've received this netmail by mistake or need help, please let me know.\r");
$o->msg = $msg->render();