<aside> 🔁 Synced from GitHub #5050ff9fd1bb. Edit in the paidhr-system-docs repository, not here: changes made in Notion are overwritten.

</aside>

Notifications & email

Status: Live

💡 In plain words

Notifications are how PaidHR tells people things.

There are four kinds: emails, the bell in the app, phone pop-ups (push), and announcements HR writes to everyone or a group. Most are sent automatically when something happens, such as a request submitted, payroll approved or a birthday. Companies can also add extra emails to chosen people at particular steps. Emails carry the company's branding.

Like the office's post room. Most letters are sent automatically when something happens, and HR can also put up a notice on the board.

Who's involved: the system (sends automatically), HR (announcements, extra emails), and everyone (receives).

In one paragraph

PaidHR tells people things in four ways: email (SendGrid dynamic templates, about 60 kinds), in-app notifications (the bell in web and mobile), push (Firebase, to the mobile app) and announcements (company-wide or group messages written by HR). Most are sent by core-backend as a side effect of something happening: a request submitted, a payroll approved, a birthday. Companies can also add custom notifications: extra emails to chosen roles or people when a given event reaches a given stage. Every email is branded with the company's white-label agent (name, domain, logo).

Kinds

Kind Sent by Examples
Account core-backend Company registration and approval, employee/admin account setup, email confirmation, password reset, onboarding nudges (days 1, 4, 8, 13, 14), flex-account warning and suspension
Activity core-backend Request activity, approval activity (with one-click buttons), exit approval (with survey link), exit interview scheduled (with a calendar invite attached), reliever notice, profile update requests, violations, feedback, conversations, document/survey/task assignments, external loan declined (with the lender's reason, if given)
Payroll & payments core-backend Payroll preview, payroll approval, payment schedule, payslips
Bulk import results core-backend Employees, contractors, payroll changes, exemptions, compensation, exits, redeployments, suspensions, PFA and HMO enrolment
Celebrations core-backend Birthday and anniversary cards (08:00 daily; image and message configurable)
EWA ewa-service Weekly earnings, withdrawal declined, loan eligibility
Time & attendance ewa-service Shift reminders, terminal scan not recorded

Announcements

HR writes an announcement, chooses an audience (everyone, departments, offices, saved announcement groups, or a custom selection) and publishes it. Employees see it in-app and mark it read (Admin/Announcements: Add, CreateAnnouncement, GetAudiences, Finish, groups).

Custom notifications

Settings → Notifications (Admin/Custom_Notifications). A custom notification says: when this type of event (leave request created, leave approved, leave cancellation requested, plan cycle opened, payroll creation…) reaches this stage, email these entities (roles or people). Types and valid stages come from GetTypes and GetValidStages.

How an email is built

flowchart LR
  EV[Event in a service] --> ES[EmailService.SendXxxEmail<br/>agent name, alias, domain, logo,<br/>recipient, data]
  ES --> TPL[SendGrid dynamic template<br/>id from environment config]
  TPL --> MAIL[Email]
  ES -. "template id missing or<br/>action link failed" .-> FB[Ordinary template]