We can send email to designated recipients when the Integration Service runs a workflow.
For Example: If you want to track how long a session takes to complete, you can configure the session to send an email containing the time and date the session starts and completes. Or, if you want the Integration Service to notify you when a workflow suspends, you can configure the workflow to send email when it suspends.
To send email when the Integration Service runs a workflow, perform the following steps:
- Configure the Integration Service to send email. Before creating Email tasks, we need configure the Integration Service to send email (Administrator will config).
- Create Email tasks. Before you can configure a session or workflow to send email, you need to create an Email task.
- Configure sessions to send post-session email. You can configure the session to send an email when the session completes or fails. You create an Email task and use it for post-session email.
- Configure workflows to send suspension email. You can configure the workflow to send an email when the workflow suspends. You create an Email task and use it for suspension email.
The Integration Service sends the email based on the locale set for the Integration Service process running the session.
We can use parameters and variables in the email user name, subject, and text. For Email tasks and suspension email, you can use service, service process, workflow, and worklet variables. For post-session email, you can use any parameter or variable type that you can define in the parameter file. For example, you can use the $PMSuccessEmailUser or $PMFailureEmailUser service variable to specify the email recipient for post-session email.
Working with Email Tasks
We can send email during a workflow using the Email task on the Workflow Manager. We can create reusable Email tasks in the Task Developer for any type of email. Or, we can create non-reusable Email tasks in the Workflow and Worklet Designer.
Use Email tasks in any of the following locations:
- Session properties. You can configure the session to send email when the session completes or fails.
- Workflow properties. You can configure the workflow to send email when the workflow is interrupted.
- Workflows or worklets. You can include an Email task anywhere in the workflow or worklet to send email based on a condition you define.
Using Email Tasks in a Workflow or Worklet
We can use Email tasks anywhere in a workflow or worklet. For example, we might configure a workflow to send an email if a certain number of rows fail for a session.
For example, we may have a Session task in the workflow and you want the Integration Service to send an email if more than 20 rows are dropped. To do this, you create a condition in the link, and create a non-reusable Email task. The workflow sends an email if the session fails more than 20 rows are dropped.
Working with Post-Session Email
We can configure a session to send email when it fails or succeeds. We can create separate email tasks for success and failure email.
The Integration Service sends post-session email at the end of a session, after executing post-session shell commands or stored procedures. When the Integration Service encounters an error sending the email, it writes a message to the Log Service. It does not fail the session.
We can specify a reusable Email that task you create in the Task Developer for either success email or failure email. Or, we can create a non-reusable Email task for each session property. When you create a non-reusable Email task for a session, you cannot use the Email task in a workflow or worklet.
We cannot specify a non-reusable Email task you create in the Workflow or Worklet Designer for post-session email.
We can use parameters and variables in the email user name, subject, and text. Use any parameter or variable type that you can define in the parameter file. For example, we can use the service variable $PMSuccessEmailUser or $PMFailureEmailUser for the email recipient. Ensure that you specify the values of the service variables for the Integration Service that runs the session. You can also enter a parameter or variable within the email subject or text, and define it in the parameter file.
Email Variables and Format Tags
We can use email variables and format tags in an email message for post-session emails. We can use some email variables in the subject of the email. With email variables, we can include important session information in the email, such as the number of rows loaded, the session completion time, or read and write statistics. You can also attach the session log or other relevant files to the email. Use format tags in the body of the message to make the message easier to read.
Note: The Integration Service does not limit the type or size of attached files. However, since large attachments can cause problems with the email system, avoid attaching excessively large files, such as session logs generated using verbose tracing. The Integration Service generates an error message in the email if an error occurs attaching the file.