E-Mail Queue Module
E-Mail Queue Module
E-mail queue module is an independent module to handle all the e-mailing requirements in the
application. E-mail queue is executed by an background worker process. The worker process is
not dependent on the host for scheduling or trigger of e-mail transport. The calling application
process is not required to wait for the e-mailing to be completed.
Components
- E-mail manager will the only interface from the application to the e-mailing module
- This will accept the required parameters from the application process, generate the e-mail and push
the email to the queue table.
- The e-mail content will be generated based on the requesting process and request parameters.
- Each sub-process can have separate rules, which may add-on or override the requested parameters
- Error handling - Check for valid e-mail address format, Avoid sending to duplicates e-mails address in
the same mail. On error update to queue table and generate an error log and alarm hook.
Queue table
- The e-mail manager interface will list the emails queued and status of the e-mail
- Columns - Process, to, status, date-time sent, attempts
- Actions View, block
- View displays the content of the send or queued email, with from, to, cc, bcc, subject,
attachment names, date added, date sent and status.
-
- The e-mail sender worker process should send the emails from the queue. This is continues
independent process.
- The activities of the worker process should be logged in process register table
- The active process can be determined from the last_attempt column in the register table
- The worker process should be active for a specified time limit only (configurable, set to 1
minute). This is to overcomet he php session time-out issue.
- Before the worker process is terminated it should trigger another worker process.
- On trigger the worker process should check that if there is any other active worker process.
Continue, if no other process is active.
- Retry sending e-mail on error response
- If more than 5 e-mail failed generate an error log file, send the log file to admin, update to
alarm_hook table
- Blocked e-mails should not be sent and logged to error log. Do not hook to alarm.
- High priority e-mails should be given preference
- Any e-mail transport agent / pluging can be used sendmail, yiimail. We are using yiimail.
- The transport agent should be flexibly configured in the worker process.