I'm trying to do the something similar or the same thing.
I have an orders object, systems, object, a supervisors object, and a companies object. I have them connected to each other. Although, I want to send an email to the supervisors connected to the company and systems they are a part of.
I can only send an email to all the supervisors in the entire company. I want to be able to send an email to the supervisors the in the system the order is created in but only send them to the supervisors that are in the same company the order is for. I have the company attached to the technician the order is created on.
So how would I only send an email to the supervisors that are in the same company the technician is in and only in the system the supervisor is part of?