About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Using a Send email script
Last updated: Mar 12, 2025
You can notify recipients about events in pipelines by replacing email commands in your migrated flows with the sendmailWrapper script.
About this task
When you create a pipeline job, you can use the script
in the Bash script node. The
script acts as the mail, mailx, and sendmail commands in your migrated jobs. Before you run a
migrated job, you need to create a volume and a storage volume connection for
/mnts/ds-storage/utilityScripts/sendMailWrapper.sh
. The script is installed to the ds-storage
persistent
volume.ds-storage
You can also use the sendMailWrapper script in the before-job and
after-job subroutines. Use the
path
for your script in the Shell command field. For more information on
before/after job subroutines, see Setting up before-job and after-job subroutines in DataStage./ds-storage/utilityScripts/sendMailWrapper.sh
Procedure
Example
sendMailWrapper.sh
command in a Bash script
node:Example of theUserVars_MailBody="mail body" UserVars_MailSubject="mail subject" UserVars_MailRecipient="abc@mail.com" echo -e "${UserVars_MailBody}" | /mnts/ds-storage/utilityScripts/sendMailWrapper.sh -s "${UserVars_MailSubject}" ${UserVars_MailRecipient} echo -e "To: abc@ibm.com\nSubject: Test\nContent-Type: text/html\nMIME-Version: 1.0\n<html><body><pre><b>Test</b><br></pre></body></html>"| /mnts/ds-storage/utilityScripts/sendMailWrapper.sh -t echo "test mail body" | /mnts/ds-storage/utilityScripts/sendMailWrapper.sh -v -s "Test Mail" abc@xxx.com
sendMailWrapper.sh
command in a Shell
command:echo "mail body" | /ds-storage/utilityScripts/sendMailWrapper.sh -a /mnts/attachement1.txt -s "subject" support@ibm.com
Was the topic helpful?
0/1000