Creating a sample Email Task:
You can create Email tasks in the Task Developer, Worklet Designer, and Workflow Designer.
1. In the Task Developer, click Tasks > Create.
1. In the Task Developer, click Tasks > Create.
2. The Create Task dialog box appears. Select an Email task and enter a name for the task. Click Create.

3. The Workflow Manager creates an Email task in the workspace, Click Done.

4. Select the email task and Double-click on it to edit --> Go to the Properties tab.

a) Enter the email address of the mail recipient in the Email User Name field.
b) Enter the subject of the email in the Email Subject field Or you can leave this field blank.
c) Click the Open button in the Email Text field to open the Email Editor.

Note:
1. You can incorporate format tags and email variables in a post-session email. However, you cannot add them to an Email task outside the context of a session.
2. 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.
The following table describes the email variables that you can use in a post-session email:
Email Variable
|
Description
|
%a<filename>
|
Attach the named file. The file must be local to the Integration Service. The following file names are valid: %a<c:\data\sales.txt> or %a</users/john/data/sales.txt>. The email does not display the full path for the file. Only the attachment file name appears in the email.
Note: The file name cannot include the greater than character (>) or a line break.
|
%b
|
Session start time.
|
%c
|
Session completion time.
|
%d
|
Name of the repository containing the session.
|
%e
|
Session status.
|
%g
|
Attach the session log to the message.
|
%i
|
Session elapsed time.
|
%l
|
Total rows loaded.
|
%m
|
Name of the mapping used in the session.
|
%n
|
Name of the folder containing the session.
|
%r
|
Total rows rejected.
|
%s
|
Session name.
|
%t
|
Source and target table details, including read throughput in bytes per second and write throughput in rows per second.
|
%u
|
Repository user name.
|
%v
|
Integration Service name.
|
%w
|
Workflow name.
|
%y
|
Session run mode (normal or recovery).
|
%z
|
Workflow run instance name.
|
Note: The Integration Service ignores %a, %g, and %t when you include them in the email subject. Include these variables in the email message only.
|
The following table lists the format tags you can use in an Email task:
Formatting
|
Format Tag
|
tab
|
\t
|
new line
|
\n
|
6. Click OK twice to save the changes.
Now we have create re-usable command task and now we need to use this in session inside the workflow. (Open the workflow or worklet where you want to use this command task).

Note:
- On Success E-Mail: Send an email alter on session succeeded.
- On Failure E-Mail: Send an email alter on session failure.
8. Select Task as On Success/Failure E-Mail, Type as Reusable/Non-reusable and Click the Open button in the Email Text field to open the Email Editor
9. Click on 'OK'.

Note:
