This is an old revision of the document!


Notification - the end of identity's last contract

This notification is a part of the Extras module.

The LRT LastContractEndNotificationTask sends an email notification to holders of a specified role and optionally the manager of a contract that a user's last contract is ending, i. e., the user is leaving. The recipients of the notification can be modified in the LRT setup and the notification template can be modified as well.

There are two different notifications this LRT can send:

  1. notification sent a specified number of days before the end of identity's last contract
  2. notification sent the day that identity's last contract ends

Each notification can use a different notification template (and must use a different topic).

This tutorial describes how to prepare this notification.

The visual part of the notification can be configured since standard templates are used. Extras comes with two basic stub templates which can be used here.

To set it up, go the left panel, choose Notifications>Templates. Look for templates 'ContractEndInFuture' and 'ContractEndNow'. If you see them, you can edit them by clicking the magnifying glass if you want (see below).

If you don't see them, you will have to create them from the xml files with corresponding names. They can easily be found here.

You can create your own template by modifying the stubs. You have these objects available:

  • user's full name (first name, last name, login, e. g., "Petra Šťastná, pstasna", String only)
  • user's department from tree node (String only)
  • the date of the end of the user's contract (String only)
  • user's manager (full IdmIdentityDto)

Next, we have to define the topics for the notification. In the left panel, click Notifications>Configuration and search topics extras:contractEnd and extras:contractEndInXDays.

If you don't find them, click the green button Add and fill them out as shown below:

You can specify additional recipients of the notification in the topic description.

Finally, we can set up the LRT. In the left menu, go to Settings>Task scheduler>Scheduled tasks and click the green button Add. Select the task type LastContractEndNotificationTask and specify the configuration of the LRT.

You can specify how many days before the contract's end the notification should be sent. If you set it to 0 the notification will be sent the day the contract ends and the extras:contractEnd topic will be used. If you write a positive integer x (1, 2, …) the notification will be sent x days before the contract ends and the extras:contractEndInXDays topic will be used.

The notification is sent x days before the end of the contract or sooner. This is useful if for some reason the LRT did not run one day, it will simply be sent the next day.

You can select the role that the recipients of the notification will have assigned. You can only select one so if you need multiple ones, you have define multiple LRTs.

And finally, you can check the box and select whether the user's manager is to be notified as well. Only one manager will receive the notification!

The last thing remaining is to run the LRT using the green arrow button. You can user CRON to plan when the LRT should be run.

I highly recommend you turn off sending emails before the first run which will send notification about the end of all contracts in x days.
Each entity will only be processed once by the LRT. If the notification about the end of a contract was sent before, the same LRT will not send it again.
  • by cirkval