tbl_mail_event

-1 rows


Description

Module: HRMS Notification & Workflow Engine
Purpose: Defines the rules, content, and recipients for automated email notifications triggered by specific system events (e.g., status change, request submission, reminder).
Data: Stores event names, email template IDs for both staff and employees, criteria for recipient targeting, and status flags.
Process Usage:
- Referenced by system services to identify which email to send (template) and to whom (criteria) when a defined event occurs.
- Manages complex notification logic, including whether an employee should also receive the “staff” version of a mail.
Key Points:
- Essential for transactional communication, alerts, and workflow management.
- Provides granular control over who receives which notification variant.
Business Impact: Ensures timely and accurate communication related to HR processes and employee lifecycle events.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id bigserial 19 nextval('tbl_mail_event_id_seq'::regclass)

Primary key
Format: Integer (auto-increment)
Used as: Unique identifier for a single mail event configuration.

event_name varchar 100 null

The unique name of the system event that triggers this mail (e.g., “Leave_Request_Submitted,” “Onboarding_Task_Due”).
Format: Varchar/Text.

event_type varchar 30 null

The classification of the event (e.g., Birthday work anniversary , wedding anniversary Informational).
Format: Varchar/Text.

employee_template_id int8 19 null

FK: Reference to a mail template master table
Meaning: The template ID used for the employee who is the subject of the event (the requester/owner).

employee_template_subject varchar 100 null

The static or parameterized subject line for the email sent to the employee.

staff_template_id int8 19 null

FK: Reference to a mail template master table
Meaning: The template ID used for staff/approvers/HR involved in the event (the recipients other than the subject employee).

staff_template_subject varchar 100 null

The static or parameterized subject line for the email sent to staff/approvers.

is_employee_include_in_staff_mail bool 1 false

Flag indicating if the subject employee should also receive the “staff” version of the email (e.g., for dual confirmation).
Format: Boolean.

staff_mail_send_in varchar 100 null

Defines the context or role in which the staff mail is sent (e.g.,CC BCC).
Format: Varchar/Text.

template_criteria text 2147483647 null

JSON or Text rule defining which employees should receive the mail (e.g., criteria based on department, job role, or specific condition).
Usage: Filters the target employee list.
Format: JSONB/Text.

staff_criteria text 2147483647 null

JSON or Text rule defining which staff/approvers should receive the mail (e.g., direct manager, second-level manager, specific HR role).
Format: JSONB/Text.

staff_custom_criteria text 2147483647 null

Additional custom or exceptional rules for staff recipient selection, if the standard staff_criteria is insufficient.
Format: JSONB/Text.

is_active bool 1 null

Flag indicating whether this automated mail event is currently enabled in the system.
Format: Boolean.

createdby varchar 500 null

FK: public.tbl_userlogin.id or public.tbl_employee.employeeid
Meaning: The user who created this mail event configuration.

createddate timestamp 29,6 null

Timestamp of when the configuration record was created.
Format: Timestamp with timezone.

modifiedby varchar 500 null

FK: public.tbl_userlogin.id or public.tbl_employee.employeeid
Meaning: The last user who modified this configuration record.

modifieddate timestamp 29,6 null

Timestamp of the last modification to the configuration record.
Format: Timestamp with timezone.

Indexes

Constraint Name Type Sort Column(s)
tbl_mail_event_pkey Primary key Asc id

Relationships