Maintaining more than one Send Mail Template ?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
asnagaraj
Participant
Posts: 26
Joined: Wed Jun 25, 2003 12:41 am

Maintaining more than one Send Mail Template ?

Post by asnagaraj »

Hi ppl,

I have two set of jobs in a project. Each of the set of jobs should send mails to two different set of ppl.

Job Set 1 -> send mail to mail ids (abc@abc.com, def@def.com)
Job Set 2 -> send mail to mail ids (ghi@ghi.com, jkl@jkl.com)

Is it possible to modify and maintain two different templates for this ?

Iam using Notification stage. (No (unix shell script / DSSendmail routine))
I am not planning to change the From/To section in the JobNotificationActivity.

Please let me know a solution at the soonest.

Naga.
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Re: Maintaining more than one Send Mail Template ?

Post by JDionne »

Naga, can you please back up for me a bit. How did you get the template to sent to two diferent people? I have had to write some crazy crap to use 3rd party mail systems to get DS to send to more than one person. Can you step me through what you did?
Jim
asnagaraj wrote:Hi ppl,

I have two set of jobs in a project. Each of the set of jobs should send mails to two different set of ppl.

Job Set 1 -> send mail to mail ids (abc@abc.com, def@def.com)
Job Set 2 -> send mail to mail ids (ghi@ghi.com, jkl@jkl.com)

Is it possible to modify and maintain two different templates for this ?

Iam using Notification stage. (No (unix shell script / DSSendmail routine))
I am not planning to change the From/To section in the JobNotificationActivity.

Please let me know a solution at the soonest.

Naga.
Sure I need help....But who dosent?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This shouldn't be a problem and doesn't involve a need for different templates. :? Not being totally sure what you mean by "job sets", this answer may be a little off. I'm also not sure what you meant by "I am not planning to change the From/To section in the JobNotificationActivity".

If you need to send the same email in one job to two different people, you can do it in two ways. 1) put both email addresses in the "Recipients email address" with a space between them or 2) if possible, setup an email group that includes both emails and then send your email to the group.

If you need to send two different emails, use two Notification Activity stages.

Not sure it that answers your question or not...
-craig

"You can never have too many knives" -- Logan Nine Fingers
asnagaraj
Participant
Posts: 26
Joined: Wed Jun 25, 2003 12:41 am

Post by asnagaraj »

I think i confused. Here is what i need.

I have 2 separate sequence of jobs in a single project. One sequence is scheduled to run everyday and it sends mails to a group of people. The second sequence is scheduled to run once in a week and it has to send mails to a completely disjoint set of people from what sequence one sends.

I am using Job sequencers and Job notification activity. I am giving a logical from and to email addresses in my Job Notification activity. I altered the dssendmail template text file to have the actual EMail address so that in future if i have to add one or more email addresses or remove anything, i can remove it just in the template and neednt really care about changing all Jobs.

In this scenario how can i send mails to different groups for every sequence of jobs ?

is it possible ?
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
Since you putting the email list in the send template itself, it will not be possible to have two different email list in the template.

I think Chulett suggestion is the right way of doing it.
This way your template will remain a general and not specific.

Ketfos
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

asnagaraj wrote:I altered the dssendmail template text file to have the actual EMail address so that in future if i have to add one or more email addresses or remove anything, i can remove it just in the template and neednt really care about changing all Jobs.
This is what is generally known as a "Bad Idea" and is not the way to go. :wink:

Seriously, you can't maintain multiple templates, so you are boxing yourself in trying to do it this way. Using Contact/Email Groups is the most flexible way to handle email notification addressing, allowing you to maintain who gets what without having to touch the jobs.

Or you could write your own email 'wrapper' routines, which would allow you to parameterize any of the fields. That way, for instance, a list of email addresses could be passed in as a Job Parameter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply