add data-attributes and print form data in order for email #351

Closed
opened 2025-10-14 16:54:07 -06:00 by navan · 0 comments
Owner

Originally created by @mckennapsean on 4/23/2017

Fixes #76 and pulled in some ideas from #90 to store data in the HTML form element.

For example, the HTML element can contain a data-sheet="responses" to send the data into responses sheet, or whichever sheet you want. By default, no data element uses the same default before (no breaking functionality). Similarly, you have to use data-email if you want to send an email in the Google Script (or set the variable in the Javascript).

The motivation is that I am trying to make it easier for people to just use the Javascript and Google Script without changing them. They just change things in the HTML, which makes it easier to deploy changes, like changing emails or which spreadsheet to store data in.

I think there are more things we can move here, over time, but I wanted to see what people think of this idea.

Lastly, I have the form fields get stored as a stringified array and use that array later when printing out the email. This makes sure that the email gets printed out in order of the form data! :)

*Originally created by @mckennapsean on 4/23/2017* Fixes #76 and pulled in some ideas from #90 to store data in the HTML form element. For example, the HTML element can contain a `data-sheet="responses"` to send the data into responses sheet, or whichever sheet you want. By default, no data element uses the same default before (no breaking functionality). Similarly, you have to use `data-email` if you want to send an email in the Google Script (or set the variable in the Javascript). The motivation is that I am trying to make it easier for people to just use the Javascript and Google Script without changing them. They just change things in the HTML, which makes it easier to deploy changes, like changing emails or which spreadsheet to store data in. I think there are more things we can move here, over time, but I wanted to see what people think of this idea. Lastly, I have the form fields get stored as a stringified array and use that array later when printing out the email. This makes sure that the email gets printed out in order of the form data! :)
navan 2025-10-14 16:54:13 -06:00
  • closed this issue
  • added the
    in-review
    label
Sign in to join this conversation.
No labels
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
awaiting-review
awaiting-review
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
chore
chore
discuss
discuss
discuss
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
epic
epic
external-dependency
external-dependency
external-dependency
hacktoberfest-accepted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
in-progress
in-progress
in-progress
in-review
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
merge-conflicts
merge-conflicts
please-test
please-test
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
spam
spam
starter
starter
starter
starter
starter
starter
starter
starter
starter
technical
technical
technical
technical
technical
user-feedback
user-feedback
user-feedback
user-feedback
user-feedback
user-feedback
wontfix
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/learn-to-send-email-via-google-script-html-no-server#351
No description provided.