My nodejs app accesses google calendar api using service account credentials. I'm able create events and also email notifications are being sent to attendees from my personal mail id though I use my domain user id as impersonator. However, if I update events using domain id as impersonator, the emails are sent from domain user mail id which is quite confusing. Is this the expected behaviour? I want all emails to be sent from my personal mail id. Is this possible?
I have done domain wide delegation already using domain user id. For better understanding let me just explain. Now I have three IDs.
- My personal Gmail id
- Service account id generated using the above personal id.
- Domain user id. A separate domain mail id which is provided domain wide delegation of authority for the purpose of inviting guests to events.
Now when I use the domain user id to create events, the mail is sent from my personal email id and not from the domain user id. But on updating events, using the domain user id as impersonator, the mail gets sent from the domain user id and not from my personal id. Which is quite confusing. If I don't give impersonator while updating events, the mail gets sent from service account id. The same is the case for deleting events. Now I want all the email to be sent from personal mail id. And not from service account or the domain id. Please help
Following is the nodejs snippet for impersonation. I have used domain user mail id as impersonator.this.jwtClient = new JWT(client_email,null, private_key,
SCOPES,impersonator);