Move mailer details into a separate table
This commit is contained in:
@@ -6,7 +6,7 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Models\Address;
|
||||
use App\Models\{Address,Mailer};
|
||||
use App\Jobs\AddressPoll as Job;
|
||||
|
||||
class CommBinkpSend extends Command
|
||||
@@ -25,6 +25,8 @@ class CommBinkpSend extends Command
|
||||
*/
|
||||
protected $description = 'BINKP send';
|
||||
|
||||
private const ID = 'BINKP';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
@@ -34,10 +36,12 @@ class CommBinkpSend extends Command
|
||||
{
|
||||
Log::info('CBS:- Call BINKP send');
|
||||
|
||||
$mo = Mailer::where('name',self::ID)->singleOrFail();
|
||||
|
||||
$ao = Address::findFTN($this->argument('ftn'));
|
||||
if (! $ao)
|
||||
throw new ModelNotFoundException('Unknown node: '.$this->argument('ftn'));
|
||||
|
||||
Job::dispatchSync($ao);
|
||||
Job::dispatchSync($ao,$mo);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user