Skip to main content

Create a batch job for reminder emails or alerts

This article explains how to create batch jobs to send automated email reminders based on key dates in SelectHR.

H
Written by Harry Ledger
Updated over a month ago

Batch jobs in SelectHR allow you to send automated emails or alerts based on key dates, such as upcoming birthdays or length of service reminders. They help reduce manual admin by ensuring the right people are notified at the right time.

⚠️ Important: This is a complex configuration that should only be completed by users with detailed knowledge of SelectHR and its database structure.

  • This is not covered by standard support. It is considered a configuration change request.

  • If you'd like training or consultancy for this, speak to your account manager or raise a case online to request their contact details. This may incur additional costs.

Prerequisites

To follow this guide, you’ll need:

  • A working knowledge of SQL and the SelectHR database structure.

  • Access to the Admin Tool.

  • A plan for your batch job, including:

    • What the job is for (e.g. reminder for Fixed Term Contract ending).

    • Who should receive notifications (e.g. HR, Manager, Employee).

    • The date field the job uses (e.g. contract end date).

    • Frequency (e.g. daily).

    • Email content and required merge fields.


Create the batch job

  1. In the Admin Tool, click Batch Jobs.

  2. Click Create a new batch job.

  3. Enter a name using this format:
    [Organisation initials] – [Type] – [Purpose]
    Example: TAG – Employee – FTC ending in 6 weeks

  4. Add a clear description.

  5. Leave the Locked option unticked.


Set the data source

  1. Click Change next to Data Source.

  2. Choose the SelectHR database.

  3. Select the authentication method (Windows or SQL Server).

  4. Enter the credentials if required, then click OK.

  5. Drag the required table(s) or view(s) into the window.

  6. Create joins as needed.

  7. Select all required fields:

    • Date field for the reminder

    • Merge fields for email

    • At least one key field

  8. Select the primary key (e.g. Person Number) and click Key Field.

  9. Click OK through each window until complete.

Link the key field

  1. In View Properties, double-click the key field.

  2. Click Change next to Reference.

  3. Select the appropriate table:

    • Person Number: SelectHR\Person.Details

    • Appointment Number: SelectHR\Employee.Appointment History

    • Career Number: SelectHR\Employee.Career History

    • Absence Number: SelectHR\Absence.History

  4. Click OK through each window.


Add the email notification

  1. Expand the Messages section.

  2. Click Add, then choose Mail Message.

  3. Enter a description, e.g. Email to Manager.

  4. Select the Window Field (the date field you’re using).

  5. Set Window Start and Window Finish, e.g.:

    • Window Field: Start Date

    • Window Start: 1 month before

    • Window Finish: 2 weeks before

Valid entries: 1 week before, 2 weeks before, Today, Tomorrow, 1 week after, etc.

  1. Set Processing Frequency, e.g. Daily, 1 week, 1 month

  2. Select Next Process Date and time (outside working hours is ideal)

  3. Enter the email Subject and Body

    • Use Merge Data to insert fields (e.g. employee name, dates)


Add recipients

Ensure the data source includes Person Number linked to SelectHR\Person.Details.

  1. In the Recipients section, click Add.

  2. Choose recipient type:

    • Returned in notification data: a user found by the batch job

    • Evaluated from notification data: e.g. the manager of the employee

    • Specific people: users in the system

    • Another email address: enter manually

  3. Complete the required picklists and click OK

  4. Repeat to add more recipients as needed

🤓 Tip: If you change the data source later, delete and recreate the message and recipients to avoid errors.


Test the batch job

Always test in a non-live environment first.

  1. Ensure the batch job, message, and email are enabled.

  2. Confirm there is at least one test record within the window range.

  3. In Mail Message, set Next Process Date to yesterday.

  4. Save and click Execute the selected batch job.

The job will now run and send emails based on your configuration.

Did this answer your question?