Some message optimisation, added Echomail processing

This commit is contained in:
Deon George
2021-07-31 00:35:52 +10:00
parent 6f26bc4c71
commit d937547599
15 changed files with 476 additions and 134 deletions

25
app/Traits/MsgID.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
/**
* Add MsgID to new models
*/
namespace App\Traits;
use Illuminate\Support\Arr;
use App\Models\Setup;
trait MsgID
{
public function save(array $options = [])
{
if (! $this->exists) {
$ftns = Setup::findOrFail(config('app.id'))->system->match($this->fftn->zone);
if (is_null(Arr::get($this->attributes,'msgid')))
$this->attributes['msgid'] = sprintf('%s %08x',$ftns->ftn4d,timew());
}
return parent::save($options);
}
}