E-mail Notification - Report in the Body of the mail

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

E-mail Notification - Report in the Body of the mail

Post by DSFreddie »

Hi All,

I am creating a statistics report after the ETL cycle run & I am currently attaching this report through the email notification & sending it to stakeholders.

Is there a way I can send the content of the report in the e-mail body itself?

I browsed through the forum for an answer & couldnt find any solution to it.

Any thoughts are appreciated
Freddie
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's been discussed a number of times here. To get it in the body you need to "roll your own" routine to send mail with a variable body. You could start with DSSendMail and tweak it, or start from scratch.
-craig

"You can never have too many knives" -- Logan Nine Fingers
josh.guffey
Participant
Posts: 40
Joined: Thu Apr 17, 2008 1:52 pm
Location: Huntsville, AL

Post by josh.guffey »

DSFreddie here is an example of server routine that will take a variable for the body:

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H

   FullArg = ""

   If ToAddress <> "" Then
      FullArg<-1> = "To:":ToAddress
   End
   If FromAddress <> "" Then
      FullArg<-1> = "From:":FromAddress
   End
   If Subject <> "" Then
      FullArg<-1> = "Subject:":Subject
   End
   If SMTPServer <> "" Then
      FullArg<-1> = "Server:":SMTPServer
   End
   If Attachments <> "" Then
      FullArg<-1> = "Attach:":Attachments
   End
   If MessageBody <> "" Then
      FullArg<-1> = "Body:":MessageBody
   End

   Code = DSSendMail(FullArg)
   
   Ans = Code
Here are the descriptions for the Arguments:

Code: Select all

ToAddress - Who to send mail to, e.g. you@there.com
FromAddress - Who the mail is from, e.g. me@here.com
Subject - Subject line
SMTPServer - Name of server to contact for sending mail
Attachments - Pathname of file to send as attachment - multiple paths may be given separated by commas
MessageBody - One or more lines of text, separated by \n if multi-line
Post Reply