Notifications and Alerts in XNAT
XNAT can be configured to send automated notifications on system events to a series of email address of your choice. It also provides multiple mechanisms for allowing you to alert XNAT users.
Developer Note
This functionality has been overhauled and now uses the XAPI notifications api. You can find additional documentation and working examples of this in the Swagger XAPI browser embedded in your XNAT application by going to Administer > Site Administration > Miscellaneous > View Swagger
Notifications Prerequisite: Configure the XNAT Email Server
In order to send any automated or manual notifications, SMTP must be enabled in your XNAT and the XNAT Email Server must be properly configured. These settings can be updated at Administer > Site Administration > Email Server. Contact your local network administrator if you are not sure which settings to use here.
Editing Default Email Messages
The Notifications Admin page allows you to edit the default email messages sent to users when a variety of situations occur within your Xnat. These events are outlined below along with a list of the shortcodes used to configure the message (outlined in more detail below):
User Registration Notifications
When editing the Password Reset Email:
The email that is sent to users who request a password reset has a unique shortcode in it that must be included: RESET_LINK. This shortcode will be replaced with a clickable URL that the user must go to in order to reset their password. The link includes a newly created token that is only good for one use. This token will expire after the amount of time specified in XNAT Security Settings > User Logins/Session Controls > Alias Token Timeout.
Email Trigger Event | Available Shortcodes |
---|---|
User RegistrationThe email message sent to users upon their registration. | USER_FIRSTNAME - The first name of the user who will be sent the message. |
New User RequestThe email message sent out when a new user account is created but has not yet been enabled. | TIME - The time of user creation. |
New User NotificationThe email message sent out when a new user account registration has been created. | TIME - The time of user creation. |
New User VerificationThe email message sent to a newly registered user's email to verify the newly created account. | USER_FIRSTNAME - The new user's first name. |
Disabled User VerificationThe email message sent out when a previously disabled user account is verified and reactivated. | DATE_INPUT - The date on which the user was re-verified. |
User Account Management Notifications
Email Trigger Event | Available Shortcodes |
---|---|
Forgot UsernameThe email message sent to a user's email address when they have lost their username. | USER_USERNAME - The requested username |
Forgot PasswordThe email message sent to a user's email address when they have forgotten their password. This email will be sent with a password reset link to allow the user to input a new password. | USER_FIRSTNAME - The first name of the user receiving the password reset. |
Email Change RequestThe email message sent to alert a user that someone has requested to change the email for the account which is currently associated with the recipient email address. | USER_USERNAME - The username of the account. |
Verify Email Change RequestThe email message sent out to verify a change of email address when one has been requested by the user within the XNAT system. | USER_USERNAME - The username of the account. |
Email Address Change SuccessfulText of the email message sent to both the original and new email address associated with a user account to alert both that the email address for that account has been successfully changed. | NEW_EMAIL - The new email address for the account |
Project Access Request Notifications
Email Trigger Event | Available Shortcodes |
---|---|
Project Access RequestThe email message sent out to project owners when a user requests access to their project. | PROJECT_NAME - The name of the project the user is attempting to access. |
Project Access ApprovalThe email message sent out to a user when their request for project access has been accepted. | PROJECT_NAME - The name of the project. |
Project Access DenialThe email message sent out to a user when their request for project access has been denied. | PROJECT_NAME - The name of the project for which access was requested. |
Project Access InvitationThe email message sent out to a user when they have been invited to join a project. | PROJECT_NAME - The name of the project. |
Data Transfer Notifications
Email Trigger Event | Available Shortcodes |
---|---|
Batch Transfer CompleteThe email message sent to the initiating user when a batch data transfer to the archive has been successfully completed. | USER_FIRSTNAME - The first name of the contacted user. |
Upload By Reference SuccessThe email message sent when a user has uploaded a file or files to the system by reference successfully. | USER_USERNAME - The user who requested the upload. |
Upload By Reference FailureThe email sent when a user's upload by reference attempt has failed. | USER_USERNAME - The user who requested the upload. |
Pipeline Processing Notifications
Email Trigger Event | Available Shortcodes |
---|---|
Pipeline SuccessThe email message sent out when an experiment pipeline has completed successfully without errors. | USER_FIRSTNAME - The first name of the contacted user. |
Pipeline FailureThe email message sent out when an experiment pipeline has failed before completion due to an error. | PIPELINE_NAME - The name of the pipeline. |
Autorun Pipeline SuccessThe email message sent out to the user when the autorun pipeline field is enabled in Xnat and the automatically run pipeline completes successfully. | USER_FIRSTNAME - The first name of the contacted user. |
Error Handling Notifications
Email Trigger Event | Available Shortcodes |
---|---|
Error MessageThe email message sent out to site administrators when an error has occurred within the system. | SITE_NAME - The name of the xnat site. |
Unauthorized Data AttemptThe email message sent when one of a several types of unauthorized data or login access attempts are recognized by the system. | TYPE - The type of data attempt. |
System Path ErrorThe email message sent to the site admin when Xnat is unable to find the file system (e.g. archive, build, prearchive directories). | ERRORS_LIST - The list of the errors that have been found. |
Data Of Interest Notifications
Email Trigger Event | Available Shortcodes |
---|---|
Data AlertThe email message sent from one user to another to alert each other about possibly useful data within their XNAT. | USER_FIRSTNAME - The first name of the user who initiates the message. |
Full Shortcode Reference
System emails are configured using a set of shortcodes which will allow for the emails to be customized both to your Xnat site as well as to the recipient of the email itself. These shortcuts are listed below and the shortcuts related to a specific email message can be seen above.
Shortcode | Replacement Value |
---|---|
SITE_NAME | Your XNAT's site name, which is set in Administer > Site Administration > Site Setup. |
SITE_URL | A link to your Xnat site, the url of which is set in Administer > Site Administration > Site Setup. |
USER_USERNAME | The username or login of the registered user, which is unique and set by the user. |
USER_FIRSTNAME | The first name provided by the registered user. This can be edited by the user in their profile, or by the site administrator in Administer > Users. |
USER_LASTNAME | The last name provided by the registered user. This can be edited by the user in their profile, or by the site administrator in Administer > Users. |
USER_LOGIN | The login information for the user. |
USER_EMAIL | The email provided by the registered user. This can be edited by the user in their profile, or by the site administrator in Administer > Users. |
USER_PHONE | The phone number provided by the registered user. This can be edited by the user in their profile, or by the site administrator in Administer > Users. |
LAB_NAME | The name of the lab where the user is registered. |
ADMIN_MAIL_LINK | The primary XNAT administration contact email, which is set in Site Administration > Site Setup. This email will be sent to the user as a link so they may quickly compose a help message. |
HELP_EMAIL | The Help Contact Info email specified above. |
DATE_INPUT | The date when the action occurred. |
TIME | The time at which the action occurred. |
PROJECT_NAME | The name of the project referred to in the email. |
STDOUT | The stdout of the related error. |
STDERR | The stderr for the error. |
ERRORS_LIST | A list of the encountered errors. |
RESET_LINK | Used in the Forgot Password email only, this link will be provided to allow the user to reset their password. |
VERIFY_URL | Used in the New User Verification email only, this link will be used to verify the new user within the Xnat system. |
FORGOT_LOGIN_URL | Used in the New User Verification email only, this link is used if the user has forgotten their login information. |
RQ_ACCESS_LEVEL | Used in project access emails only, this is the level of access being requested or given to the user within the project. |
RQA_COMMENTS | Used in project access emails only, these are comments provided by the user to justify access to a requested project role. |
LIST_PERMISSIONS | Used in project access emails only, this is a list of the permissions the user will be given based on the level of access defined above. |
ACCESS_URL | Used in project access emails only, this is the link used to respond to the project access request. |
ACCEPT_URL | Used in Project Access Invitation email only, this is the link sent to allow the user to accept the invitation to work on the project. |
LOGIN_URL | Used in Disabled User Verification only, this is a link to the login page for the Xnat site. |
ERROR_TIME | Used in Error Message email only - the time at which the error occurred. |
ERROR_MESSAGE | Used in Error Message email only, this is the message related to the error. |
PROJECT_ACCESS_REQUESTS | Used in new user emails only, these are the projects which a new user has open access requests for when they join. |
REVIEW_LINK | Used in new user emails only, the link used to accept or deny the request to join the Xnat. |
USER_COMMENTS | Used in new user emails only, these are the comments that the system administrator has provided to the new user. |
PIPELINE_NAME | Used in Pipeline emails only - the name of the pertinent pipeline. |
EXPERIMENT_NAME | Used in pipeline emails only - the name of the experiment on which the pipeline is being run. |
SUCCESS_URL | Used in pipeline emails only - the link where the user can navigate to see details of the pipeline run. |
PIPELINE_STEP | Used in the Pipeline Failure email only - the step in the pipeline at which the run failed. |
CONTACT_EMAIL | Used in Pipeline Failure email only - the email to which the user can direct their help questions to. |
ATTACHMENTS_STATEMENT | Used in Pipeline Failure email only - other information about the pipeline failures, if applicable. |
PROCESS_NAME | Used for Batch Transfer email only - the name of the process that has been completed. |
NUMBER_MESSAGES | Used for Batch Transfer email only - the number of messages that were transferred. |
MESSAGES_LIST | Used for Batch Transfer email only - the list of transferred messages. |
TYPE | Used for Unauthorized Data Attempt email only - the type of data attempt. |
USER_DETAILS | Used for Unauthorized Data Attempt email only - the details of the user who attempted to access the data. |
NEW_EMAIL | Used for email change messages only - the new email to be associated with the user account. |
CHANGE_EMAIL_LINK | Used for Email Change Verification only - the link used to verify the user account's change of email address. |
DUPLICATES_LIST | Used only in Upload By Reference Success email - a list of the duplicate files within the upload. |
REQUEST_LINK | Used only in Data Alert message - the link the user can follow to view the data. |
SENDER_MESSAGE | Used only in Data Alert message - the message sent by the user alongside the data alert. |
TIME_SENT | Used only in Data Alert message - the time at which the message was sent. |
Sending Custom Notifications to Users via Email
See: Sending Emails to Registered Users
Creating Site-wide Alerts
See: Admin UI - Site Wide Alerts