I’m not sure if I Understood your point but you can join Recipients’ email addresses and pass it to send email activity, so it will send One email to all.
Hi @Vidya_Lingappa
Kindly follow the below steps that could help you resolve your issue
- use excel application scope and pass the file path of your excel
- use read range activity and get the output of variable type datatable and name it out_dt
- use a for each row loop and pass the above variable as input
- inside the for each row loop use a if condition and mention the condition as
Convert.ToInt32( row(“Yourscorecolumnname”).ToString)<40
if this condition gets passed it will go to THEN part of if condition
inside the THEN part use a assign activities like this
out_mailid = row(“Column11”).ToString+“;”+row(“Column12”).ToString
where out_mailid is variables of type string
5.while still being inside the for each row loop, use send outlook mail activity and mention the variable in TO property and mention the subject and body you want
Hope this would help you
CHeers @Vidya_Lingappa
Hey @Vidya_Lingappa
- Use Excel Application Scope Activity and pass the file path of your excel
- Use read range activity and get the output of variable type datatable and name it SampleDT
- Define before loop proces.
List<String> UsersList = New List(Of String); List<String> ManagersList = New List(Of String);
- Use a for each row loop and pass the above SampleDT as input
- Convert.ToInt32( row(“Score Column”).ToString)<40
if this condition gets passed it will go to THEN part of it.
inside the THEN part we will add Failed user in list and Their respective manager in Manager list.
6 outside loop just use Send Mail Acitvity(outlook or else as per your needs :)) and in To
mention String.Join(“;”,Mail_ReciepientsListStr_Users.Distinct.ToArray)
and in CC Mention String.Join(“;”,Mail_ReciepientsListStr_Managers.Distinct.ToArray) managers list.
even with this way if failed users are having same manager it won’t go to same manager twice
Find Below sample for your basic understanding or Reference
OutlookSendEmailMultipleReciepientsSample.xaml (12.2 KB)
Cheers
Regards…!!
Aksh
Aksh, thanks so much. I will try today and let you know if I face any issues.
Aksh, You sample code is excellent. But I have a small issue. In your SampelDT table you have 2 columns: UserEmail and ManagerEmail. So where are you assigning these variables? I could not locate them in the invoke method. I am a bit confused. Because I have column(11) as UserEmail and column(12) as ManagerEmail. Please clarify.
Palani, Thank you for the explanation. I have assigned the row(“Column11”).ToString";“+row(“Column12”).ToString+”;"+"testmgr@test.com" to a mailid variable. and the system is complaining: End of Expression expected. What am I missing? Could you please advise.
we need to mentionlike this buddy
row(“Column11”).ToString+“;”+row(“Column12”).ToString+“;”+“testmgr@test.com”
just a small correction + is missing
Cheers @Vidya_Lingappa
were you able to get that now buddy @Vidya_Lingappa
Aksh, I need little bit clarification. In your SampelDT table you have 2 columns: UserEmail and ManagerEmail. So in your code where are you assigning these variables? I could not locate them in the invoke method. I am a bit confused. Because I have column(11) as UserEmail and column(12) as ManagerEmail. I am waiting for your response. Could you please clarify.
Palani, yes got it.
Great @Vidya_Lingappa
Cheers
Note:- if you want to let me know when you have to ask something please tag me using @ with my username. so can get notifications
Regards…!!
Aksh
Thanks and it is working now. @aksh1yadav
Hi Palani, in the method proposed by you, how do I avoid duplicate emails to managers? meaning if there are 2 users reporting to same manager.
Any idea? please let me know.
Thanks,
Any how they are different users with different marks right, though the manager is same, as the users are different with different or same marks even, manager must be intimated about them individually know buddy…
So i think we dont need to find the duplicates with same manager with 2 different users
Kindly correct me if i m wrong
Cheers @Vidya_Lingappa