I have a table that stores distribution list, first name, last name, email address, and I would like to create a loop activity that pulls in first name and email address for a specific list. So my query is as follows:
SELECT distribution_list, f_name, l_name, email
FROM dept_db.dbo.rpt_distribution_list
WHERE distribution_list = ‘Test’
I would like the email activity to send an email to each address on the list using a variable for email, and then include the first name in the body of the email using another variable. I think that I have to put the above query into the SQL Script section of the loop activity. I tried putting in a set variable and email activity within the Loop_row_1 section of the loop, but this didn’t work. Can anyone show me how to set up such a script?