Configuring Email notifications
Email notifications feature allows you to send notifications to users who are expected to perform a certain action on a step of a workflow.
Before you begin
- Ensure that the application is set up to send emails to users.
For more information, see smtp section - env_settings.ini file parameters file.
- Ensure that you have imported the email_integration_model.zip data model file in the Admin UI. The email_integration_model.zip data model file is located here: $TOP/mdmui/env-export/emailintegration. For more information, see Importing data model.
- The email notifications artifacts like report, input specs are included with the data model for the feature. If you change the code, you need to also change the name of these artifacts.
Configuring email notifications
Proceed as follows if you want to configure email notifications.
- Stop the services.
- Go to the
Email integration configuration
section in the $TOP/bin/conf/env-settings.ini file, set the value asenable=yes
, and save the file. - Run the $TOP/bin/configureEnv.sh file.
- Start the services.
- Go to $TOP/bin/conf/classpath/jars_custom.txt file. Verify that the email_integration.jar file location is $TOP/mdmui/libs/emailIntegration.
Configuring email notifications by using customized sample code
Proceed as follows if you want to configure email notifications by using customized sample code.
- Log in to Admin UI.
- Generate the email-integration.jar file.
- Get the source code from the
$TOP/mdmui/samples/com.ibm.mdm.email.integration.zip file. The source code
contains the following two classes.
- com.ibm.mdm.approval.notification.GenerateAndSendApprovalEmail.java
- This class contains the code for generating the email content that is described in the Step 3. It also retrieves the email of the performer set for the step from which this extension is called and sends the email. You can update this code to change the content required in the email. The sample code has the logic to create the attribute difference table. The code also picks up the exit values that are provided in the step and provides them as the actionable options in the email.
- com.ibm.mdm.approval.notification.ExecuteUserResponse.java
- This class contains the code that is attached to the report described in the Step 4. This code reads the response emails with specific subject format based on the user actions that are taken in the notification email and parses the subject lines to take actions on respective items in the workflow. If the method that generates response email subjects in the com.ibm.mdm.approval.notification.GenerateAndSendApprovalEmail.java class is updated, you need to also update the logic to read the emails in this class.
- Compile the sample code with your changes and generate a JAR file with email_integration.jar as the file name.
- Stop the services.
- Go to the
Email integration configuration
section in the $TOP/bin/conf/env-settings.ini file, set the value asenable=yes
, and save the file.Note: This step ensures that the email_integration.jar file gets fetched from the $TOP/mdmui/libs/emailIntegration folder and the JAR path gets automatically updated in the $TOP/bin/conf/classpath/jars_custom.txt and $TOP/bin/conf/env-settings.ini files. - Replace the JAR on the server present in the $TOP/mdmui/libs/emailIntegration folder with the JAR that you have generated in the Step 2b.
- Run the $TOP/bin/configureEnv.sh file to update the class
path, and start the services.
Note: No overwrite is required while running the configureEnv.sh file.
- Start the services.
- Get the source code from the
$TOP/mdmui/samples/com.ibm.mdm.email.integration.zip file. The source code
contains the following two classes.
- Configure the workflow from which you want to send email notifications.
- Go to the .
- Click New to create your own workflow. Else, select an existing workflow and click Edit.
- In the Workflow Steps section, click the step from which you want the email notifications to be sent.
- Click Add script, above the Edit Workflow Step section. The script parameters get added to the workflow.
- In the Script field, click Edit.
- Add the following to the scriptlet editor and click Save.
//script_execution_mode=java_api="japi://com.ibm.mdm.approval.notification.GenerateAndSendApprovalEmail.class"
- Configure Check Email and Execute report. This report checks
the inbox of the
From
address and reads the fetched emails since the last report run. The application has a report job (Report Type: Email Check, Report Name: Check Email and Execute) scheduled to run repeatedly. This report job has an input spec where you must configure the email host, username, password, mail protocol, and folder details for reading the emails. The report filters the emails having the specified subject format and parses the subject line to get the collaboration area, step, entry, and exit values. The exit value that is retrieved from the response email is set on the entry and the entry then moves forward in the workflow.- Go to the .
- In the Report Console, click Check Email and Execute report.
- In the Parameters Value Set section, add the details for the email account that is going to receive responses from the users, and click Save.
- Configure your email application.
- In your email application, set a folder in the email account that sends the emails to users where the responses are going to be received. Check Email and Execute report checks this folder for responses.
- Configure the
Url Helper
Lookup table.- Go to the .
- Open the
Url Helper
Lookup table. - Specify the Value field for the
HelperUrl
key as the<Protocol>://<IP address>:<Port>
of the server where the application is running. Examplehttp://127.0.0.1:9090
Results
When a workflow reaches a certain step, performers receive auto-generated emails. This email notification is sent to the details that you specify for each performer in the . This email notification has certain actions that such users can directly click and allow further processing of the workflow without the need to log in to the application.Note: When an item enters a step, the application
triggers an email notification to users who are performers for that step only if email integration
script is added for that step. No email generation happens for Initial step.