Page 1 of 1

Email notification

Posted: Wed Jan 27, 2010 10:15 am
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.

Posted: Wed Jan 27, 2010 10:20 am
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.

Posted: Wed Jan 27, 2010 11:19 am
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

Posted: Wed Jan 27, 2010 11:46 am
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.

Posted: Wed Jan 27, 2010 12:07 pm
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 ......

Posted: Wed Jan 27, 2010 2:44 pm
by mekrreddy
Thanks alot swades..
I will try and post here..

Posted: Thu Jan 28, 2010 4:20 am
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.

Posted: Thu Jan 28, 2010 11:17 am
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?

Posted: Thu Jan 28, 2010 11:27 am
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.

Posted: Thu Mar 04, 2010 8:21 pm
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..