NodesNew also now sends an Echomail
This commit is contained in:
@@ -32,9 +32,6 @@ class NodesNew extends Netmails //implements ShouldQueue
|
||||
$this->since = $since;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mail representation of the notification.
|
||||
*/
|
||||
public function toNetmail(object $notifiable): Netmail
|
||||
{
|
||||
$o = $this->setupNetmail($notifiable);
|
||||
@@ -42,14 +39,27 @@ class NodesNew extends Netmails //implements ShouldQueue
|
||||
|
||||
Log::info(sprintf('%s:+ Sending a NEW NODE LIST to [%s] at address [%s]',self::LOGKEY,$ao->system->sysop,$ao->ftn));
|
||||
|
||||
$o->subject = sprintf('Here is a list of new nodes on clrghouz since %s',$x=$this->since->format('Y-m-d'));
|
||||
$o->subject = sprintf('Here is a list of new nodes on clrghouz since %s',$this->since->format('Y-m-d'));
|
||||
$o->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
|
||||
|
||||
$o->msg = $this->report($ao);
|
||||
$o->set_tagline = 'All aboard!';
|
||||
|
||||
$o->save();
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the rendered new nodes report.
|
||||
*/
|
||||
public function report(Address $ao): string
|
||||
{
|
||||
// Message
|
||||
$msg = $this->page(FALSE,'new nodes');
|
||||
|
||||
$msg->addText(sprintf("Hi %s,\r\r",$ao->system->sysop))
|
||||
->addText(sprintf("The following new system have been defined on clrghouz since %s.\r\r",$x));
|
||||
->addText(sprintf("The following new system have been defined on clrghouz since %s.\r\r",$this->since->format('Y-m-d')));
|
||||
|
||||
$this->list->loadMissing(['system']);
|
||||
|
||||
@@ -95,11 +105,6 @@ class NodesNew extends Netmails //implements ShouldQueue
|
||||
}
|
||||
}
|
||||
|
||||
$o->msg = $msg->render();
|
||||
$o->set_tagline = 'All aboard!';
|
||||
|
||||
$o->save();
|
||||
|
||||
return $o;
|
||||
return $msg->render();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user