RSVP form HTML
index.html
email, name, extras (number of additional guests), and invite_code.
Setup steps
Create a Google Sheet
Create a new Google Sheet at sheets.google.com. Add the following column headers in row 1, exactly as written (case-sensitive):
Each RSVP submission will append a new row with these five values.
| A | B | C | D | E |
|---|---|---|---|---|
email | name | extras | invite_code | timestamp |
Open Google Apps Script
In your Google Sheet, go to Extensions → Apps Script. This opens the script editor bound to your sheet.
Paste and deploy the script
The script must handle HTTP POST requests from the website. The form data is serialized by jQuery and sent as a POST body, matching the field names above. A minimal handler looks like this:After pasting the script, click Deploy → New deployment, choose Web app, set “Execute as” to Me, and “Who has access” to Anyone. Copy the deployment URL.
Google Apps Script
Paste the script URL into scripts.js
Find the Replace the long URL string (
$.post() call in js/scripts.js and replace the existing URL with your deployment URL:js/scripts.js
AKfycbyo…/exec) with your own deployment URL.After making this change, re-run gulp to regenerate js/scripts.min.js:Set the invite code
The invite code is validated client-side by comparing the MD5 hash of the user’s input against hardcoded hash values. Open The two hash values correspond to two valid invite codes (e.g. one for general guests and one for VIP guests). To set your own codes:
js/scripts.js and find:js/scripts.js
- Decide on a numeric invite code, e.g.
1234 - Compute its MD5 hash — use any online MD5 tool or run
echo -n 1234 | md5sumin a terminal - Replace one or both hash strings in the condition above
- Re-run
gulpto minify the updated script
Invite code security
Alert markup helper
Status messages (info, danger) are rendered using thealert_markup() function:
js/scripts.js
'info', 'danger', 'success', 'warning'). The second argument is the HTML message string. This function is called both before the network request (“Just a sec!”) and inside the .done / .fail callbacks.
Google Apps Script can send email notifications whenever a new RSVP is submitted. In your Make sure the script has permission to send email when you deploy it.
doPost function, add a call to MailApp.sendEmail() after appending the row:Google Apps Script
