Email Notifications
Stakeholders are interested in the progress of samples as they move through a workflow. Email alerts of events can provide them with real-time notifications.
Some possible uses of notifications include the following:
| • | Completion of a workflow for the billing department |
| • | Manager review requests |
| • | Notice of new files added via the LabLink interface |
| • | Updates on samples that are not following a standard path through a workflow |
BaseSpace Clarity LIMS provides a simple way of accomplishing this using a combination of the Clarity LIMS API, EPP / automation triggers, and Simple Mail Transfer Protocol (SMTP).
The send_email() method uses the Python smptlib module to create a Simple Mail Transfer Protocol (SMPT) object to build and send the email. The attached script does the following:
| 1. | Gathers relevant data from the Clarity LIMS API endpoints. |
| 2. | Generates an email body according to a template. |
| 3. | Calls the send_email() function. |
Connect to Clarity LIMS SMTP with:
host='localhost', port=25
Because of server restrictions, the script can send emails from only:
noreply.clarity@illumina.com
The automation / EPP command is configured to pass the following parameters:
|
-u |
The username of the current user (Required) |
|
-p |
The password of the current user (Required) |
|
-s |
The URI of the step that launches the script (Required) |
Example command line:
python /opt/gls/clarity/customextensions/emails_from_Clarity.py -u {username} -p {password} -s {stepURI}
| • | The script can be executed using a Clarity LIMS automation / EPP command, and triggered by one of the following methods: |
| – | Manually, via a button on theRecord Details screen. |
| – | Automatically, at a step milestone (on entry to or exit from a screen). |
| • | The script can also be triggered outside of a Clarity LIMS workflow, using a time-based job scheduler such as cron. |
| • | You are running a version of Python supported by Clarity LIMS, as documented in the Technical Requirements. |
| • | The example code is provided for illustrative purposes only. It does not contain sufficient exception handling for use 'as is' in a production environment. |
