From fddf85e7a63d48f7a4d96a8465001dc26b6de432 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Wed, 11 Sep 2019 21:10:48 -0500 Subject: [PATCH] removed sendevemailjob class in favor of the newer class. --- app/Jobs/SendEveMailJob.php | 120 ------------------------------------ 1 file changed, 120 deletions(-) delete mode 100644 app/Jobs/SendEveMailJob.php diff --git a/app/Jobs/SendEveMailJob.php b/app/Jobs/SendEveMailJob.php deleted file mode 100644 index 6d08fd9a1..000000000 --- a/app/Jobs/SendEveMailJob.php +++ /dev/null @@ -1,120 +0,0 @@ -body = $mail->body; - $this->recipient = $mail->recipient; - $this->recipient_type = $mail->recipient_type; - $this->subject = $mail->subject; - - $this->connection = 'redis'; - } - - /** - * Execute the job. - * Utilized by using SendEveMailJob::dispatch($mail); - * The model is passed into the dispatch function, then added to the queue - * for processing. - * - * @return void - */ - public function handle() - { - //Get the esi configuration - $config = config('esi'); - - //Retrieve the token for main character to send mails from - $token = EsiToken::where(['character_id'=> 92626011])->first(); - - //Create the ESI authentication container - $config = config('esi'); - $authentication = new EsiAuthentication([ - 'client_id' => $config['client_id'], - 'secret' => $config['secret'], - 'refresh_token' => $token->refresh_token, - ]); - - //Setup the Eseye class - $esi = new Eseye($authentication); - - //Attemp to send the mail - try { - $esi->setBody([ - 'approved_cost' => 100, - 'body' => $this->body, - 'recipients' => [[ - 'recipient_id' => $this->recipient, - 'recipient_type' => $this->recipient_type, - ]], - 'subject' => $this->subject, - ])->invoke('post', '/characters/{character_id}/mail/', [ - 'character_id'=> 92626011, - ]); - } catch(RequestFailedException $e) { - Log::warning($e); - return null; - } - - $this->delete(); - } - - /** - * The job failed to process. - * - * @param Exception $exception - * @return void - */ - public function failed($exception) - { - Log::critical($exception); - } -}