Skip to content

Commit

Permalink
New Applicant Notification
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMicallefYBSU committed Aug 14, 2024
1 parent 15d90ec commit 3fb822d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/Controllers/Training/ApplicationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ public function applyPost(Request $request)

//New Applicant in Instructor Channel
$discord = new DiscordClient();
$discord->sendMessageWithEmbed(config('app.env') == 'local' ? intval(config('services.discord.web_logs')) : intval(config('services.discord.instructors')), 'New training session scheduled #'.$session->id, $session->instructor->user->fullName('FLC').' has scheduled a new training session with '.$session->student->user->fullName('FLC').' on '.$request->get('scheduled_time'));
$discord->sendMessageWithEmbed(config('app.env') == 'local' ? intval(config('services.discord.web_logs')) : intval(config('services.discord.applications')), 'New Training Applicant!', $application->user->fullName('FLC').' has just applied to control at Gander Oceanic!
[View their application now](https://ganderoceanic.ca/admin/training/applications/'.$application->reference_id.')');

//Redirect to application page
return redirect()->route('training.applications.show', $application->reference_id);
Expand Down
1 change: 1 addition & 0 deletions app/Services/DiscordClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function createTrainingThread($channelId, $name, $user)
$response = $this->client->post("channels/{$channelId}/threads", [
'json' => [
'name' => $name,
'applied_tags' => [1271845980865695774], //Tag ID for 'New Request'
'message' => [
'content' => $user.', your application has now been approved. Welcome to Gander Oceanic!
Expand Down

0 comments on commit 3fb822d

Please sign in to comment.