updated contract mailer in contractadmincontroller

This commit is contained in:
2020-04-26 06:47:02 -05:00
parent 66896ab73e
commit 754fbb9aad
4 changed files with 9 additions and 15 deletions

1
.env
View File

@@ -38,6 +38,7 @@ ESI_SECRET_KEY=TdnNGRM8RTNSifZdaIc9yHTTkYPgYEEXHRIbT6oY
ESI_USERAGENT='W4RP Services' ESI_USERAGENT='W4RP Services'
ESI_CALLBACK_URI='http://services.w4rp.space/callback' ESI_CALLBACK_URI='http://services.w4rp.space/callback'
ESI_PRIMARY_CHAR=93738489 ESI_PRIMARY_CHAR=93738489
ESI_ALLIANCE=99004116
EVEONLINE_CLIENT_ID=e5848fea3618427a8ee0dccb6a04fc62 EVEONLINE_CLIENT_ID=e5848fea3618427a8ee0dccb6a04fc62
EVEONLINE_CLIENT_SECRET=TdnNGRM8RTNSifZdaIc9yHTTkYPgYEEXHRIbT6oY EVEONLINE_CLIENT_SECRET=TdnNGRM8RTNSifZdaIc9yHTTkYPgYEEXHRIbT6oY

View File

@@ -184,21 +184,15 @@ class ContractAdminController extends Controller
} }
private function NewContractMail() { private function NewContractMail() {
//Get all the users with a specific permission set
$users = UserPermission::where(['permission' => 'contract.canbid'])->get()->toArray();
//Get the esi config //Get the esi config
$config = config('esi'); $config = config('esi');
//Cycle through the users with the correct permission and send a mail to go out with the queue system. $mail = new JobSendEveMail;
foreach($users as $user) { $mail->sender = $config['primary'];
$mail = new JobSendEveMail; $mail->subject = 'New Alliance Production Contract Available';
$mail->sender = $config['primary']; $mail->recipient = $config['alliance'];
$mail->subject = 'New Alliance Contract Available'; $mail->recipient_type = 'alliance';
$mail->recipient = $user['character_id']; $mail->body = "A new contract is available for the alliance contracting system. Please check out <a href='https://services.w4rp.space'>Services Site</a> if you want to bid on the production contract.<br><br>Sincerely,<br>Warped Intentions Leadership";
$mail->recipient_type = 'character'; ProcessSendEveMailJob::dispatch($mail)->onQueue('mail');
$mail->body = "A new contract is available for the alliance contracting system. Please check out <a href='https://services.w4rp.space'>Services Site</a>.";
ProcessSendEveMailJob::dispatch($mail)->onQueue('mail');
}
} }
} }

View File

@@ -18,8 +18,6 @@ class AuthServiceProvider extends ServiceProvider
/** /**
* Register any authentication / authorization services. * 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 * @return void
*/ */

View File

@@ -5,5 +5,6 @@
'useragent' => env('ESI_USERAGENT'), 'useragent' => env('ESI_USERAGENT'),
'callback' => env('ESI_CALLBACK_URI'), 'callback' => env('ESI_CALLBACK_URI'),
'primary' => env('ESI_PRIMARY_CHAR', 93738489), 'primary' => env('ESI_PRIMARY_CHAR', 93738489),
'alliance' => env('ESI_ALLIANCE', 99004116),
]; ];
?> ?>