Dual Email Architecture
Platform delivery, the six policy gates, and the modular admin surface.
Job-Easy operates two entirely separate email systems. This strict physical separation prevents application outreach volume from damaging the platform's core transactional IP reputation, while ensuring recruiters reply directly to the candidate's actual inbox.
Job applications sent by the user to recruiters and hiring managers.
outreach + integrations-googleTransactional messages sent by the system to its own users (receipts, resets).
mailPlatform Mail: The Queue and Policy Gates
Platform mail never fires synchronously. Calling enqueue() writes a NotificationDelivery row to the database. A cron job then periodically processes the queue.
Before any message is handed to the transport layer, it must successfully pass six strict policy gates:
- Address presence: Does the user have a verified email?
- Kill switch: Is the global
MAIL_ENABLEDflag set to false? - Non-production guard: Outside production, drops mail unless the recipient is explicitly in
MAIL_ALLOWED_RECIPIENTS. - Suppression list: Did this address previously hard-bounce or complain?
- User preferences: Did the user explicitly opt out of this specific notification category?
- Anti-noise caps: Has the system sent too many messages of this exact category to this user recently?
The enqueue() Invariant
enqueue() is designed to never throw for a delivery or policy reason. It only throws for a severe programmer error (like passing a bad template key). If a gate rejects a message, it simply returns a suppressed status. A delivery decision must never be treated as an exception that rolls back a database transaction.Modular Admin Surface
There is no dedicated /admin/email-settings page anymore. The system splits concerns between the settings slice and the mail slice.
The mail slice exports operational components (like MailOperationsProvider, MailStatusBanner, and MailToolsBody) via its index.ts. These are rendered as card bodies inside the global System Settings page.
Crucially, every mail diagnostic operation (pause, resume, rotate, test-send) applies immediately. They do not wait for the global "Save changes" bar, preventing a trap where an admin clicks "Test Send" and expects it to respect unsaved changes in the draft.