Hi all, I am currently working on a project which sends out reminder emails to reporting manager for contracts that are expiring, department heads have to be cc-ed in the email too, we have manage to complete the following,
Sort contracts according to reporting manager email, vlookup another excel (master list) to include the department head to be cc-ed in the email.
Currently the reminders are sent out by sorting the reporting manager emails, however if the manager is taking care of more than one department, only one department head get cc-ed in the email.
I have attached the part where we generate emails.
How can I create a loop to ensure that both departments head get cc-ed in the email?
The current setup will send and email to Alan and cc John, we would like to cc Celia too. and it will continue in a loop, the next reminder email will be sent Tom, cc peter.
then use a filter datatable and filter the input table on primary manager in loop…and then use the given expression on the filtered table…then you will have cc of only Alan related Dept heads
I hope the datatable which has contract details (including manager email id) have email id of manager in column manager_email, if not you can change the manager_email column name with desired one.
here i am looping through the sorted table which has the reporting manager email id , that is why in above query we have row variables which represent the row through which it is being iterated.
the above variable str_cc will give the emails of dept head in string seperated by ;