I'm looking into using the GMail API to send out emails programtically for one of our systems. I believe I need to create a service account and then set it up with domain-wide-access in order to delegate the email sending ( so the email appears to come from the actual user and not my program ). My question is, if I go this route - is there a way to block out certain users so that the service account cannot "delegate" for them? For example I would like to be able to generate and send emails for our sales team, but I do not want the api to be able to generate any emails for our senior officers.
The flow of things would be....our program gathers info from our database and then loops through this data and uses the gmail api to generate the emails for the sales staff. I'm very new to the google/gmail api and am leery of giving the service account domain-wide-access for delegation.
Is there a "best practice" approach for doing something like this?