From 754fbb9aadc6f92a719428a71d3a2b94d9145c42 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Sun, 26 Apr 2020 06:47:02 -0500 Subject: [PATCH] updated contract mailer in contractadmincontroller --- .env | 1 + .../Contracts/ContractAdminController.php | 20 +++++++------------ app/Providers/AuthServiceProvider.php | 2 -- config/esi.php | 1 + 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.env b/.env index 09c79b23a..7c0d69ece 100644 --- a/.env +++ b/.env @@ -38,6 +38,7 @@ ESI_SECRET_KEY=TdnNGRM8RTNSifZdaIc9yHTTkYPgYEEXHRIbT6oY ESI_USERAGENT='W4RP Services' ESI_CALLBACK_URI='http://services.w4rp.space/callback' ESI_PRIMARY_CHAR=93738489 +ESI_ALLIANCE=99004116 EVEONLINE_CLIENT_ID=e5848fea3618427a8ee0dccb6a04fc62 EVEONLINE_CLIENT_SECRET=TdnNGRM8RTNSifZdaIc9yHTTkYPgYEEXHRIbT6oY diff --git a/app/Http/Controllers/Contracts/ContractAdminController.php b/app/Http/Controllers/Contracts/ContractAdminController.php index fcfd161cd..19fc9a772 100644 --- a/app/Http/Controllers/Contracts/ContractAdminController.php +++ b/app/Http/Controllers/Contracts/ContractAdminController.php @@ -184,21 +184,15 @@ class ContractAdminController extends Controller } private function NewContractMail() { - //Get all the users with a specific permission set - $users = UserPermission::where(['permission' => 'contract.canbid'])->get()->toArray(); - //Get the esi config $config = config('esi'); - //Cycle through the users with the correct permission and send a mail to go out with the queue system. - foreach($users as $user) { - $mail = new JobSendEveMail; - $mail->sender = $config['primary']; - $mail->subject = 'New Alliance Contract Available'; - $mail->recipient = $user['character_id']; - $mail->recipient_type = 'character'; - $mail->body = "A new contract is available for the alliance contracting system. Please check out Services Site."; - ProcessSendEveMailJob::dispatch($mail)->onQueue('mail'); - } + $mail = new JobSendEveMail; + $mail->sender = $config['primary']; + $mail->subject = 'New Alliance Production Contract Available'; + $mail->recipient = $config['alliance']; + $mail->recipient_type = 'alliance'; + $mail->body = "A new contract is available for the alliance contracting system. Please check out Services Site if you want to bid on the production contract.

Sincerely,
Warped Intentions Leadership"; + ProcessSendEveMailJob::dispatch($mail)->onQueue('mail'); } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 8c3cd2825..f828feda1 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -18,8 +18,6 @@ class AuthServiceProvider extends ServiceProvider /** * Register any authentication / authorization services. - * These gates will always choose the highest roles - * We use gates in some of the graphics, but will work to utilize if statements instead shortly * * @return void */ diff --git a/config/esi.php b/config/esi.php index e3cb6a086..38e3c7406 100644 --- a/config/esi.php +++ b/config/esi.php @@ -5,5 +5,6 @@ 'useragent' => env('ESI_USERAGENT'), 'callback' => env('ESI_CALLBACK_URI'), 'primary' => env('ESI_PRIMARY_CHAR', 93738489), + 'alliance' => env('ESI_ALLIANCE', 99004116), ]; ?> \ No newline at end of file