Email notification

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mekrreddy
Participant
Posts: 88
Joined: Wed Oct 08, 2008 11:12 am

Email notification

Post by mekrreddy »

Hello,

In my requirement I need to send emails to 10 diff people with 10 diff attachments, Do I need to use 10 diff email notification stages to accomplish this? Is there a way I can minimise the no of stages being used.??

Please give your thoughts...
Thanks in advance
reddy.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

yes, you can minimise the numbers to 3 using startloop, endloop and 1 notification activity and parameterizing email address and attachment file name. Or to 1 by writing a routine which uses dssendmail() (this will help if you need to change the mail text too). But all depends on requirement.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

priyadarshikunal wrote:yes, you can minimise the numbers to 3 using startloop, endloop and 1 notification activity and parameterizing email address and attachment file name. ...
2 more stages required UserVariables_Activity + Nested_Condition :D
mekrreddy
Participant
Posts: 88
Joined: Wed Oct 08, 2008 11:12 am

Post by mekrreddy »

Thanks for your responses,

Can you guys please eloberate how I can dynamically say Email1 should get attch1 and email2 should get attcht2, so on..
Email1 - attch1
email2 - attch2
....


Thanks for your help.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Use UserVariables to map e-mail list and attachment depending on startloop counter value. Use "If Then Else" in Expression field.

Code: Select all

If StartLoop_Activity_Email.$Counter =1 Then test1@test.com Else  If StartLoop_Activity_Email.$Counter =2 Then test2@test.com ......

If StartLoop_Activity_Email.$Counter =1 Then File1(Job Parameter) Else  If StartLoop_Activity_Email.$Counter =2 Then File2 ......
mekrreddy
Participant
Posts: 88
Joined: Wed Oct 08, 2008 11:12 am

Post by mekrreddy »

Thanks alot swades..
I will try and post here..
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

swades wrote:Use UserVariables to map e-mail list and attachment depending on startloop counter value. Use "If Then Else" in Expression field.

Code: Select all

If StartLoop_Activity_Email.$Counter =1 Then test1@test.com Else  If StartLoop_Activity_Email.$Counter =2 Then test2@test.com ......

If StartLoop_Activity_Email.$Counter =1 Then File1(Job Parameter) Else  If StartLoop_Activity_Email.$Counter =2 Then File2 ......
think on your suggestion, can you reduce any stage?

using a list loop like

test1@test.com,attachment1.txt|test2@test.com,attachment2.txt|.....

and using field function on counter will takeout your nested condition stage and also the user variable activity stage.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

priyadarshikunal wrote:test1@test.com,attachment1.txt|test2@test.com,attachment2.txt|.....and using field function on counter will takeout your nested condition stage ...
I am sorry ..Now I am learning new here..so be with me...what if there are more processing stages after this notification ? how do you map for email1--> attachment1, email2--> attachment2,...so on..in notification stage?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Take advantage of the $Counter functionality of the Loop stages. This should help if you have multiple lists you need to loop through.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mekrreddy
Participant
Posts: 88
Joined: Wed Oct 08, 2008 11:12 am

Post by mekrreddy »

I exactly did that,
used loop counter inside user variable, like if counter 1 email1 --> attachment1,
counter2 --> attachment2.. so on, coded in the derivation part of the user variable stage (awesome stage in sequence jobs)
thanks a bunch guys..
Post Reply