So I have a process in which a user submits a form. The user can choose multiple departments via a table in the form. There are multiple HR employees, every department has a HR employee over it. I am querying the database to obtain the email address of the HR employee. So let's say I chose 1600 CIVIL RIGHTS and 2700 TRANSIT COMMUNICATIONS CENTER as my two departments.
I want to be able to send it to both HR employees that are over those departments. But every HR employee has multiple departments, so if I chose two different departments that both happened to have the same HR employee over them, I don't want them to get two of the same email. I got it to work for the most part, the only issue I have is that when I send the email, it only gets sent to the last department's HR employee. So I believe my issue is with the table and pulling multiple values from it.
Anyone have any ideas?