Skip to content

Commit ef39f0b

Browse files
committed
feat: notify only recruiters on new applications
1 parent 7543336 commit ef39f0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

module/Applications/src/Listener/EventApplicationCreated.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Core\Mail\MailService;
1818
use Applications\Listener\Events\ApplicationEvent;
1919
use Applications\Options\ModuleOptions;
20+
use Auth\Entity\UserInterface;
2021
use Organizations\Entity\EmployeeInterface;
2122
use Organizations\Entity\EmployeePermissionsInterface;
2223

@@ -102,7 +103,9 @@ protected function sendRecruiterMails()
102103
$recruiters = $org->getEmployeesByRole(EmployeeInterface::ROLE_RECRUITER);
103104
/** @var \Organizations\Entity\Employee $recruiter */
104105
foreach ($recruiters as $recruiter) {
105-
if (!$recruiter->getPermissions()->isAllowed(EmployeePermissionsInterface::APPLICATIONS_CHANGE)) {
106+
if (!$recruiter->getPermissions()->isAllowed(EmployeePermissionsInterface::APPLICATIONS_CHANGE)
107+
|| $recruiter->getUser()->getRole() != UserInterface::ROLE_RECRUITER
108+
) {
106109
continue;
107110
}
108111

0 commit comments

Comments
 (0)