Learn-to-send-email-via-google-script-html-no-server: Can we remove the setup() function?

Created on 19 Oct 2015  路  6Comments  路  Source: dwyl/learn-to-send-email-via-google-script-html-no-server

All 6 comments

13-apps-script-with-record_data

Currently, this is setting a property (the ID of the spreadsheet) which is used to push the data into the spreadsheet. You may be able to just move the code that grab's the active spreadsheet ID and move it into the function/s that need it.

Agreed, this can be hardcoded in the script and called by a variable with very little added complexity. The person setting this up for the first time would have to replace some text in the script itself to include the spreadsheet ID. Doesn't seem too complicated as the same thing already happens in step 2 and 7 of the guide for the email/form action URL. Losing the drop down run function is a small thing imo.

I would suggest a few variables just at the top of the file, something easy like this

var webApp = '_published script URL goes here_'
var sheetLink = '_spreadsheet ID goes here_'
var sendTo = '_recipient email goes here_'

The spreadsheet ID/URL can be detected by Google's API, so the developer should not need to specify this.

We already fixed and removed this step a while ago! :)

@mckennapsean thanks for tidying up. 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EugeneFitzher picture EugeneFitzher  路  4Comments

Herbert2122 picture Herbert2122  路  4Comments

JintaYadomi picture JintaYadomi  路  3Comments

Brothman picture Brothman  路  3Comments

mckennapsean picture mckennapsean  路  3Comments