I am creating a contact us page with the following tutorial:
https://github.com/dwyl/learn-to-send-email-via-google-script-html-no-server#how
It all works fine, but I am trying to figure out the make it look good step. It talks about: Download the following Javascript file and update your index.html to point to it at the end of your file (*before the closing tag)
Where is the index.html that I need to look for? I went into edit code but this was not listed as an option
The body and head tags for your entire site (in the themes I have used) are in theme.liquid
The closing tag is so you’d paste in the proper javascript before that line. I used ctrl+f to find it.
What you might want to do instead of pasting in that long javascript directly into your theme.liquid:
Go into your theme editor, and then create a new file in the “Assets” folder, name it something (we’ll use “send-email.js” as an example), and then paste in the javascript to that file. Save it, then go back to your theme.liquid and paste the following before the closing tag:
{{ ‘send-email.js’ | asset_url | script_tag }}
so if I were to do that the above screenshot would instead look like this:
I’m not a liquid/js developer but I’ve done this many times and it seems to work well. Maybe someone more knowledgeable has a better solution. Good luck!
Thanks
I have added created the send-email.js in assets
that asset contains the code from githut (originally titled form-submission-handler.js
I have added the line of code to the theme.liquid
my form code looks like this
I still get this screen though when I submit the form: