Email - dynamically changing "to:" field
I have a database (form and view) for human resources that has contact names, phone, and email. I also have a form that keeps track of the stats of certain projects. I want to be able to send out an email notification to the project lead if the status gets changed to "problem" for example.
What I cant figure out is how to dynamically change the "to:" field. Its almost like I need to do a lookup. So it needs to look in the status form for the field of "owner" and then correspond that owner in the human resources database to the email address from that form. Can you help me out?