My understanding is, the only way to authorize a script is to execute it and then it'll do all of the authorizations it needs. How do we do this for functions that are used in conjunction with an even trigger like on form submit
?
Say I have a function like this:
function onFormSubmit(e){ ... }
If this function triggers on form submit
then e
will have the event details. But if I just execute it normally then e
will be undefined
.
And if my function needs e
to do other things, like send an e-mail using MailApp then the script will have to be authorized to send e-mail using MailApp.
So how to get the script authorized for everything that needs authorization?