diff --git a/app/Console/Commands/Moons/MoonMailer.php b/app/Console/Commands/Moons/MoonMailer.php index 2c34ca35d..0a627c0df 100644 --- a/app/Console/Commands/Moons/MoonMailer.php +++ b/app/Console/Commands/Moons/MoonMailer.php @@ -12,6 +12,8 @@ use App\Jobs\ProcessSendEveMailJob; //Library use Commands\Library\CommandHelper; use App\Library\Moons\MoonCalc; +use App\Library\Esi\Esi; +use Seat\Eseye\Exceptions\RequestFailedException; //Models use App\Models\Moon\Moon; @@ -101,7 +103,7 @@ class MoonMailerCommand extends Command $body .= "Warped Intentions Leadership
"; //Dispatch the mail job - $mail = new EveMail; + $mail = new JobSendEveMail; $mail->sender = $config['primary']; $mail->subject = "Warped Intentions Moon Rental Payment Due for " . $today->englishMonth; $mail->body = $body; @@ -111,6 +113,8 @@ class MoonMailerCommand extends Command //Increment the delay for the mail to not hit rate limits $delay += 30; + $this->SendMail($mail); + //Update the moon as not being paid for the next month? foreach($rentals as $rental) { $previous = new Carbon($rental->Paid_Until); @@ -125,6 +129,10 @@ class MoonMailerCommand extends Command $task->SetStopStatus(); } + private function SendMail(EveMail $mail) { + + } + private function UpdateNotPaid(MoonRental $rental) { MoonRental::where([ 'System' => $rental->System, diff --git a/app/Jobs/ProcessSendEveMailJob.php b/app/Jobs/ProcessSendEveMailJob.php index 67c125e7f..c13988fc2 100644 --- a/app/Jobs/ProcessSendEveMailJob.php +++ b/app/Jobs/ProcessSendEveMailJob.php @@ -50,7 +50,7 @@ class ProcessSendEveMailJob implements ShouldQueue * * @return void */ - public function __construct(EveMail $mail) { + public function __construct(JobSendEveMail $mail) { $this->body = $mail->body; $this->recipient = $mail->recipient; $this->recipient_type = $mail->recipient_type; diff --git a/app/Models/Jobs/JobSendEveMail.php b/app/Models/Jobs/JobSendEveMail.php index 182eebebc..7d648c54a 100644 --- a/app/Models/Jobs/JobSendEveMail.php +++ b/app/Models/Jobs/JobSendEveMail.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model; class JobSendEveMail extends Model { //Timestamps - public $timestamps = true; + public $timestamps = false; protected $fillable = [ 'sender', @@ -15,7 +15,5 @@ class JobSendEveMail extends Model 'recipient_type', 'subject', 'body', - 'created_at', - 'updated_at', ]; }