Skip to content

Commit

Permalink
Notif email should always be sent to admins (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
DDZBX authored Oct 8, 2024
1 parent b08e70f commit 2fc9873
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/mails/mails.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,13 @@ export class MailsService {
) {
let candidate, coach: User;
let toEmail: string;
// if user is a a candidate then get the user as candidate
// if user is a a candidate then get the coach from the candidate
if (isRoleIncluded(CandidateUserRoles, submittingUser.role)) {
candidate = submittingUser;
coach = getCoachFromCandidate(candidate);
toEmail = candidate.email || '';
coach = getCoachFromCandidate(submittingUser);
toEmail = getAdminMailsFromZone(submittingUser.zone).candidatesAdminMail;
} else {
// if user is a coach then get the candidate from the coach
coach = submittingUser;
candidate = getCandidateFromCoach(coach, candidateId);
candidate = getCandidateFromCoach(submittingUser, candidateId);
toEmail = getAdminMailsFromZone(candidate.zone).candidatesAdminMail;
}

Expand Down

0 comments on commit 2fc9873

Please sign in to comment.