diff --git a/README.md b/README.md index b07a3ac..4c76409 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,81 @@ If you're here, you're probably a potential client, collaborator, or fellow buil - **`index.html`** — The main portfolio page, hand-crafted with intention - **`styles.css`** — Clean, branded styling +- **`form-handler.js`** — Contact form submission logic (Google Sheets integration) +- **`google-apps-script/Code.gs`** — Apps Script to deploy for the Google Sheets backend - **`favicon.png`** — The mark of ClearLine - **`Codex_Horizon_Regolith_Mapping.md`** — Internal knowledge architecture documentation - **`.github/`** — Workflow and automation configuration --- -## Intelligence Rollout (IR) +## Contact Form → Google Sheets Integration + +The contact form collects leads (name, email, company, and address) and sends +each submission to a Google Sheet via a Google Apps Script Web App. + +### One-time setup + +1. **Create a Google Sheet** + - Open [Google Sheets](https://sheets.google.com) and create a new spreadsheet. + - Name it something like `ClearLine Leads`. + +2. **Add the Apps Script** + - In the spreadsheet, click **Extensions → Apps Script**. + - Delete any existing code in `Code.gs`. + - Paste in the contents of [`google-apps-script/Code.gs`](google-apps-script/Code.gs). + - Click **Save** (💾). + +3. **Deploy as a Web App** + - Click **Deploy → New deployment**. + - Under *Select type*, choose **Web app**. + - Set **Execute as** → *Me*. + - Set **Who has access** → *Anyone with the link* (recommended; reduces + automated spam compared to fully public access). + - Click **Deploy** and authorise when prompted. + - **Copy the Web App URL** shown in the confirmation dialog. + +4. **Wire up the front end** + - Open [`form-handler.js`](form-handler.js). + - Replace the placeholder on the `SCRIPT_URL` line with the URL you just copied: + ```js + var SCRIPT_URL = 'https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec'; + ``` + - Also update the `action` attribute on the `
+ +