Email task is used to send emails while running the workflow.Using email task we can get failure and success notifications
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.
|
To explain this lets take the example of a workflow with two sessions.Session1 and Session2
a)Go to create task and create an Email Task and name it as Test_email
b)Also Enter the following details
- Email User Name :
- Email subject :
- Email text:
Email User Name either you can hard code with an email id or give a workflow variable.To give Workflow variable, goto the workflow variable and create a new one to hold email address $$Email_Failure
c)You can give value to workflow variable using parameter File
Emails in the Parameter file
[Sandesh.Workflow:wkfTest]
$$Email_Failure=xyz@mail.com
d)Also make the email task as resuable so that we can use it in multiple sessions. To make it reusable create it using Task Developer.
e)To attach files through Email use the below codes in Email Text
- %a<>To attach file, Absolute path need to be given <>.
- %s Session name
- %e Session status
- %b Session start time
- %c Session completion time
- %i Session elapsed time
- %l Total records loaded
- %r Total records rejected
- %t Target table details
- %m Name of the mapping used in the session
- %n Name of the folder containing the session
- %d Name of the repository containing the session
- %g Attach the session log to the message
1)To add Email Task via session Level
Go to each session and Components level give the On Failure Email as Test_Email, also give Type as Reusable and Save.This will trigger the email for Failure
2)To add Email Task via Workflow level
Goto workflow and in the Suspension Email enter the Email task name, Also give Suspend on Error and save
Great...
ReplyDelete