8.2.1.1. User Notification Handler Module

The user notification handler module is used to send emails to the owner of a token.

This module can be used to inform users, whenever the administrator manages any aspect of their tokens.

8.2.1.1.1. Possible Actions

8.2.1.1.1.1. sendmail

The sendmail action sends an email to the tokenowner user. The email is sent, if an administrator managed the users token.

emailconfig

subject

  • optional

The subject line of the mail that is sent.

body

  • optional

Here the administartor can specify the body of the email, that is sent. The body may contain the following tags

  • {admin} name of the admin.
  • {realm} realm of the admin.
  • {action} the action that the administrator performed.
  • {serial} the serial number of the token.
  • {url} the URL of the privacyIDEA system.
  • {user} the given name of the user.

8.2.1.1.2. Code

This is the event handler module for user notifications. It can be bound to each event and can perform the action:

  • sendmail: Send an email to the user/token owner
TODO:
  • sendsms: We could also notify the user with an SMS.

The module is tested in tests/test_lib_events.py

class privacyidea.lib.eventhandler.usernotification.UserNotificationEventHandler[source]

An Eventhandler needs to return a list of actions, which it can handle.

It also returns a list of allowed action and conditions

It returns an identifier, which can be used in the eventhandlig definitions

actions

This method returns a dictionary of allowed actions and possible options in this handler module.

Returns:dict with actions
check_condition()[source]

Check if all conditions are met and if the action should be executed :return: True

description = 'This eventhandler notifies the user about actions on his tokens'
do(action, options=None)[source]

This method executes the defined action in the given event.

Parameters:
  • action
  • environment
  • options
Returns:

identifier = 'UserNotification'