Forum Discussion
Sending Outlook Email using Data Factory Pipeline
- 4 months ago
Hi anusha_2023 ,
would do it in a simpler way. Here is the order I would follow: (lookup -for each - office 365)
1. Lookup : Add a Lookup pointing to your table with a simple query:
Select name, email, subject,summary from nameTableLakehouse
2. ForEach: Connect the Lookup to the ForEach and in the Items field put:
@activity('NameLookup).output.value
This tells the ForEach to iterate over all the records returned by the Lookup.
3. Office 365 - Send an Email: Inside the ForEach add the Send an Email activity:
- To: @item().Email
- Subject: @item().subject
- Body: @item().summary
With this, each iteration of the ForEach sends one email per user with their data. Simple and clean.
If you find this helpful please give it a 👍, and if it answered your question please mark it as a solution ✅. This helps the community and motivates me to keep contributing. Thank you!
Thanks for your reply.
table is cleaned and write to Lakehouse using Notebook.
Do I need to create a separate table for each user then it would be a big manual task since I have around 50 users at the end.
I want to send last three rows in the table format in case of Name "Kesava".
Hi anusha_2023,
Don't make a new table for each user, but you should make one new table that contains all the emails you want to send and removes the duplicates.