Ensure Echomail is initialised correctly

This commit is contained in:
Deon George 2022-11-04 23:14:47 +11:00
parent b45e2c6dd8
commit 9721db185b
3 changed files with 10 additions and 0 deletions

View File

@ -60,6 +60,7 @@ final class Test extends Process
$eo = Echoarea::where('name',$msg->echoarea)->single();
$o = new Echomail;
$o->init();
$o->to = $msg->user_from;
$o->from = Setup::PRODUCT_NAME;
$o->subject = 'Test Reply';

View File

@ -205,6 +205,8 @@ class MessageProcess implements ShouldQueue
// We know about this area, store it
$o = new Echomail;
$o->init();
$o->to = $this->msg->user_to;
$o->from = $this->msg->user_from;
$o->subject = $this->msg->subject;

View File

@ -140,6 +140,13 @@ final class Echomail extends Model implements Packet
/* METHODS */
public function init(): void
{
$this->set_path = collect();
$this->set_seenby = collect();
$this->set_packet = NULL;
}
public function jsonSerialize(): array
{
return $this->encode();