Improve transactional emails

This commit is contained in:
2022-02-10 15:45:22 +00:00
parent 127c972304
commit 5e2eabac0c
16 changed files with 134 additions and 45 deletions

View File

@@ -23,7 +23,6 @@ namespace App\Listeners;
use App\Events\ApplicationApprovedEvent;
use App\Notifications\ApplicationApproved;
use App\StaffProfile;
use Illuminate\Support\Facades\Log;
class PromoteUser
@@ -46,15 +45,12 @@ class PromoteUser
*/
public function handle(ApplicationApprovedEvent $event)
{
Log::info('User '.$event->application->user->name . 'has just been promoted (application approved)');
$event->application->setStatus('APPROVED');
$event->application->response->vacancy->decrease();
$event->application->user->assignRole('reviewer');
Log::info('User '.$event->application->user->name.' has just been promoted!', [
'newRank' => $event->application->response->vacancy->permissionGroupName,
]);
$event->application->user->notify(new ApplicationApproved($event->application));
}
}