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.
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
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
- 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
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)
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+";"+“email@example.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
just a small correction + is missing
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.
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
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.
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