timbo343 Posted April 18, 2023 Posted April 18, 2023 We have a Google Sheet that when a user puts a specific value in a column an email is generated however because i created the Google Sheet and edited the code, it's being sent from my email address which is what i don't want. The sheet is shared with a couple of people and i want to be able to get the sheet to send an email from a specific account that has edit access or use the email account of the user that adds the specific value to the column. Is there a way to do this so the sheet doesn't send from my email address even though ownershiph of the form as been past to another account?
dmj Posted April 18, 2023 Posted April 18, 2023 I do vaguely remember something about this, but don't remember the specifics so forgive me if it's incorrect but it should give you some pointers. IIRC Google sheets scripts create a GCP project associated with them. I think you need to go to the GCP management console https://console.cloud.google.com find the project in there, and have a look around, possible in IAM or perhaps in Authentication and see if you can transfer ownership. 1
dmj Posted April 18, 2023 Posted April 18, 2023 This might be helpful https://developers.google.com/apps-script/guides/cloud-platform-projects 1
timbo343 Posted April 18, 2023 Author Posted April 18, 2023 Thanks. The script doesn't have a Project ID. Maybe i need to give it a project id so then i can pick it up in GCP > IAM
timbo343 Posted April 18, 2023 Author Posted April 18, 2023 To be fair, i have no idea what im doing in GCP!
dmj Posted April 18, 2023 Posted April 18, 2023 It will automatically create the project id with the project
timbo343 Posted April 18, 2023 Author Posted April 18, 2023 I dunno how but i got it to send with another user. It seems i had to authorise the script again.. somehow.
jthompson Posted April 19, 2023 Posted April 19, 2023 (edited) Share the Apps Script project with the other user (i.e. the user that you want the emails to be sent from). Open the project as that user. Set up the required triggers. The relevant functions will then exectute as that user, and so emails sent programmatically by those functions will be sent from that account. You can then remove any triggers that you've got set up uder your named account. It's a good idea to use generic accounts for these kinds of automations, as things are then less likely to break as personnel come and go. That may also mean that the associated Sheets are owned by those generic accounts, or stored in a suitably permissioned Shared Drive. Edited April 19, 2023 by jthompson 1
timbo343 Posted April 19, 2023 Author Posted April 19, 2023 Its to do with the triggers. I took the triggers out as they were owned by me and got the user to re-add the trigger.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now