jr_job_alerts_email_subscribers()
This is the main job alerts function. It’s triggered by a CRON job every n minutes.
Package
Description Description
Queries the database for pending job alerts and loops through them to find matching user alerts limiting the results to the user maximum batch size. Builds a list of the matching jobs for each user keeping the last user ID for each job ID. Loops through the matching subscribers and sends the job alert email. After the emails are sent, checks if the total subscribers is lower then the maximum batch size for each job alert (job ID). If the total subscribers are lower then the batch size the job alert is deleted, else, it’s updated with the last user id to later send the alerts to the remaining subscribers.