0
votes

I made a google script in a spreadsheet that responds on form submit. It modifies the files, makes a pdf and emails that pdf to specific people. This was made for someone else and then I transferred ownership. However, the edits to those files and emails sent, still appear under my email. How do I completely transfer the folders and everything in them a different user on the same domain so that they are the ones sending emails and modifying files?

2
You would change the e-mail in your code to the intended recipient. - DDPWNAGE
yes, it sends to people i changed it to. however, I still send the emails, not the owner of the files like i would like it to. - DrDrei

2 Answers

1
votes

You need to go into the script and add a function that calls ScriptApp.invalidateAuth
https://developers.google.com/apps-script/reference/script/script-app#invalidateAuth() then call any function like doGet using the new account to reauthenticate

0
votes

How do I completely transfer the folders and everything in them a different user on the same domain

When you transferred ownership of your files & folders, everything in them did get transferred.

... so that they are the ones sending emails and modifying files?

However, the TRIGGERS that you had set up previously belong to your account, not to the associated scripts.

You have a couple of options for stopping those triggers from running as you.

  1. Disable specific installable triggers.

    If you still have access to the offending script, open it in script editor, go to resources > Current project's triggers, and disable the triggers. Done.

    If you don't have access to the script anymore, open the script editor on any of your scripts, go to resources > All your triggers, and disable the triggers if you can identify them. This can be challenging if you use the same names for trigger functions in multiple scripts, as there is no indication here of which script they came from.

  2. De-authorize the offending script.

    As Zig's answer describes, if you still have access to the offending script, you can add a function to revoke authorization, and run it from your account.

    Alternatively, you can see all scripts that you have authorized, and revoke access directly. Go to your Account Settings page, and select "View all" under Connected apps and services, or use this link.

    enter image description here

    Select the offending script, then click "Revoke access". Done!

To get the script running under the new owner's account, you need to repeat whatever steps set it up for you, including authorization from their account.