Configuration

config.js contains the configuration for the sendMail function. The config object must be completed for the sendMail function to work correctly. This object is passed to the sendEmail function with values from the current sheet environment via the procParams object.

Please see the documentation for the parameters in const config below. All parameter values are undefined by default.

Author
  • unforswearing

Members

(inner, constant) config :Object

Update const with values specific to your project. See example configuration object below.

Type:
  • Object
Properties
NameTypeDescription
adminstring

Admin will receive error notifications

formNamestring

The name of the form used to add responses to your spreadsheet

recipientstring

Add email addresses here. All form responses will be sent to any address added. Addresses may be for one individual or an array of addresses for multiple recipients.

emailFooterstring

emailFooter specifies the html string to be used in the emails that are sent from this script. Leave blank if you do not require an email footer

sheetIdstring

Property sheetID is required for this script to work properly Properties formName and sheetId will be extracted from const formName and const sheet

sheetNameFilterstring

sheetNameFilter is used to extract the form name from the sheet name. the 'responses' default is typical for most forms.

subjectFilterstring

subjectFilter is used to create the email subject from the sheet name. the text in the subjectFilter will be added to the sheet name to generate an email subject. if you do not want the additional text in the email title you can leave this section blank -- use ''

sheetInfoObject

The first column is set to 'A' by default. To use a different first column modify the firstCol parameter to another column in your sheet.

Example
// Sample configuration 
const config = {
  admin: "rstevens@example.com",
  formName: "Site Survey",
  recipient: [ 
    "marketing@example.com",
    "ceo@example.com
  ]
  emailFooter: "<br />This is an automated message, do not reply",
  sheetId: "1234567890abcdef,
  sheetNameFilter: " Responses",
  subjectFilter: "New Submission: ",
  sheetInfo: {
    firstCol: "A",
    lastCol: "R", 
    // the lastRow parameter does not need to be edited
    lastRow: activeSpreadsheet.getLastRow(), 
  },
}