🔧 Complete HVAC Website Package

Full Technical Documentation & Integration Guide

Everything you need to understand, set up, and troubleshoot your HVAC booking system with detailed integration guides

📋 Table of Contents

  1. Buyer's Guide Overview
  2. How Integrations Work
  3. The Complete Data Flow
  4. Slack Integration Deep Dive
  5. Gmail Integration Deep Dive
  6. Google Sheets Integration Deep Dive
  7. Twilio SMS Integration Deep Dive
  8. How Each Integration is Invoked
  9. Complete Setup Instructions
  10. Testing Each Integration
  11. Troubleshooting Guide

⚙️ How Integrations Work (Overview)

The Event Chain

When a customer submits a booking form on your website, a precise sequence of events happens:

1. TRIGGER: Customer clicks "Schedule Service" button ↓ 2. VALIDATION: Form checks all fields are filled ↓ 3. SUBMISSION: Form data sent to your backend ↓ 4. PROCESSING: Backend receives the data ↓ 5. DISTRIBUTION: Data sent to 4 different integrations simultaneously: ├─ Slack → Team notification ├─ Gmail → Customer confirmation ├─ Google Sheets → Data logging └─ Twilio → SMS to customer (optional) ↓ 6. CONFIRMATION: Success/error message shown to customer

What Data is Being Sent

Every booking submission sends this JSON data through your system:

{
  "name": "John Smith",
  "phone": "555-123-4567",
  "email": "john@example.com",
  "service": "AC Repair",
  "lastServiced": "2026-06-15",
  "urgency": "urgent",
  "timestamp": "2026-08-15T10:30:00Z",
  "source": "website-form"
}

Each integration processes this data differently:

📊 The Complete Data Flow

┌─────────────────────────────────────────────────────────┐ │ │ │ CUSTOMER SUBMITS BOOKING FORM │ │ │ │ Name: John Smith │ │ Phone: 555-123-4567 │ │ Service: AC Repair │ │ Urgency: Urgent │ │ │ └────────────────────┬────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ │ │ FORM VALIDATION (React Frontend) │ │ │ │ ✓ Name not empty │ │ ✓ Phone valid (10+ digits) │ │ ✓ Service selected │ │ ✓ Urgency selected │ │ │ └────────────────────┬────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ │ │ SEND TO BACKEND (HTTP POST Request) │ │ │ │ POST /webhook/hvac │ │ │ └────────────────────┬────────────────────────────────────┘ ┌───────────┴────────────┬──────────┬────────────┐ │ │ │ │ ▼ ▼ ▼ ▼ SLACK API GMAIL API SHEETS API TWILIO API (Chat) (SendEmail) (Append) (SMS) │ │ │ │ └───────────┬────────────┴──────────┴────────────┘ │ ▼ ┌──────────────────────────────────────┐ │ Return Success Response to Form │ │ │ │ ✅ "Booking received! │ │ We'll contact you shortly." │ │ │ └──────────────────────────────────────┘

💬 Slack Integration Deep Dive

What is Slack?

Slack is a team messaging app. When a booking comes in, your team gets an instant notification in Slack instead of a phone call or email that might be missed.

What Your Team Sees in Slack

When a customer books a service, this message appears instantly in your #hvac-bookings channel:

🔔 NEW HVAC BOOKING

Customer: John Smith
Phone: 555-123-4567
Service: AC Repair
Last Serviced: June 15, 2026
Urgency: URGENT ⚠️
Timestamp: Aug 15, 2026 10:30 AM

👉 Ready to accept this booking?

The API Call (Behind the Scenes)

curl -X POST https://slack.com/api/chat.postMessage \
  -H 'Authorization: Bearer xoxb-YOUR-BOT-TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "channel": "C12345678",
    "blocks": [
      {
        "type": "section",
        "text": {
          "type": "mrkdwn",
          "text": "🔔 *NEW HVAC BOOKING*\n\n*Customer:* John Smith"
        }
      }
    ]
  }'

Complete Setup Steps

1 Create Slack App at api.slack.com
  • Go to https://api.slack.com/apps
  • Click "Create New App"
  • Select "From scratch"
  • App name: `HVAC Booking Bot`
  • Pick your workspace and create
2 Enable Bot Permissions
  • Left sidebar → "OAuth & Permissions"
  • Under "Bot Token Scopes," add:
    • chat:write (to send messages)
    • channels:read (to find channels)
    • users:read (to identify users)
  • Click "Install to Workspace"
  • Authorize the app
3 Copy Bot Token
  • After installation, find "Bot User OAuth Token"
  • It looks like: xoxb-1234567890-1234567890-XXXXXXXXX
  • ⚠️ Keep this secret! Never share publicly.
4 Create Channel & Add Bot
  • In Slack workspace, create channel #hvac-bookings
  • Right-click channel → "View channel details"
  • Copy the channel ID (looks like: C12345678)
  • Add bot to channel
5 Save Configuration

Add to your .env.local:

VITE_SLACK_ACCESS_TOKEN=xoxb-YOUR-BOT-TOKEN
VITE_SLACK_CHANNEL_ID=C12345678

Common Slack Issues

Problem Cause Solution
No message in Slack Bot not in channel Add bot to #hvac-bookings channel
"Invalid token" error Token is wrong/expired Regenerate token at api.slack.com
"Channel not found" Wrong channel ID Copy correct ID from channel details
Permissions error Bot lacks permissions Add chat:write scope and reinstall

📧 Gmail Integration Deep Dive

What is Gmail?

Gmail sends professional email confirmations to customers. When they submit a booking, they immediately get an email confirmation saying "we received your request."

What Customers Receive via Email

Subject: ✅ HVAC Service Booking Confirmed - ProAir HVAC

---

Hello John Smith,

Your HVAC service booking has been confirmed!

📋 Booking Details:
  • Service Type: AC Repair
  • Phone: 555-123-4567
  • Last Service: June 15, 2026
  • Urgency: URGENT
  • Booked: Aug 15, 2026 10:30 AM

✓ Our team received your request
✓ We'll contact you within 1 hour
✓ Save this email for your records

---

ProAir HVAC | 24/7 Emergency Service

Complete Setup Steps

1 Enable 2-Step Verification

Gmail requires 2-step verification to create app passwords:

  • Go to https://myaccount.google.com
  • Left sidebar → "Security"
  • Find "2-Step Verification" and enable it
  • Verify via phone
2 Create App Password
  • Go to https://myaccount.google.com/apppasswords
  • Select app: Mail
  • Select device: Windows Computer (or your device)
  • Click "Generate"
  • Google creates a 16-character password
  • ⚠️ Copy immediately (you won't see it again!)
3 Save Configuration

Add to your .env.local:

VITE_GMAIL_USER=booking@yourhvac.com
VITE_GMAIL_APP_PASSWORD=abcdefghijklmnop
VITE_CONTACT_EMAIL=customer@example.com

⚠️ Important:

  • Use the 16-character APP PASSWORD, not your regular password
  • The app password is different from your account password
  • Never share this app password
  • If you lose it, generate a new one

Common Gmail Issues

Problem Cause Solution
"Invalid login" error Wrong app password Generate new app password from Gmail
Email not received Email address wrong Check customer email in form
Ends up in spam Gmail filtering Add company email to customer's contacts
"Less secure apps" error Old Gmail setting Use app password, not regular password

📊 Google Sheets Integration Deep Dive

What is Google Sheets?

Google Sheets is a cloud spreadsheet (like Excel online). Every booking is automatically added as a new row. This creates a CRM database you can:

What Your Spreadsheet Looks Like

Timestamp              Name        Phone        Service      Urgency   Email
─────────────────────────────────────────────────────────────────────────────
8/15/2026 10:30 AM   John Smith  555-123-4567 AC Repair    URGENT    john@ex.com
8/15/2026 10:45 AM   Jane Doe    555-987-6543 Heating      NORMAL    jane@ex.com
8/15/2026 11:00 AM   Bob Wilson  555-456-7890 Maintenance  URGENT    bob@ex.com

Complete Setup Steps

1 Create Google Sheet
  • Go to https://sheets.google.com
  • Click "Create" (new spreadsheet)
  • Name it: `HVAC Bookings`
  • Add headers in first row:
    A: Timestamp
    B: Name
    C: Phone
    D: Service
    E: Urgency
    F: Email
2 Copy Sheet ID
  • Look at the URL: https://docs.google.com/spreadsheets/d/[SHEET_ID]/edit
  • Copy the SHEET_ID part (the long string)
  • Example: 1A2B3C4D5E6F7G8H9I0J1K2L3M4N5O6P
3 Create Service Account (Most Complex Step)
  • Go to https://console.cloud.google.com
  • Click "Create Project"
  • Project name: `HVAC Booking System`
  • Wait for project creation (1-2 minutes)
  • Left sidebar → "APIs & Services" → "Credentials"
  • Click "Create Credentials" → "Service Account"
  • Fill in:
    • Service account name: `hvac-booking-app`
    • Description: `HVAC website booking system`
  • Click "Create and Continue"
  • Grant role: `Editor`
  • Click "Continue" then "Done"
4 Create Service Account Key
  • Go to https://console.cloud.google.com/iam-admin/serviceaccounts
  • Click on the service account you just created
  • Click "Keys" tab
  • "Add Key" → "Create new key"
  • Format: JSON (very important!)
  • Click "Create"
  • A JSON file downloads automatically
5 Share Sheet with Service Account
  • Open the JSON file in a text editor
  • Find the client_email value
  • It looks like: hvac-app@project-123.iam.gserviceaccount.com
  • Go back to your Google Sheet
  • Click "Share" button (top right)
  • Paste the service account email
  • Grant: "Editor" permission
  • Click "Share"
6 Enable Sheets API
  • Go to https://console.cloud.google.com/apis/library
  • Search for "Google Sheets API"
  • Click it
  • Click "Enable"
7 Save Configuration

Add to your .env.local:

VITE_GOOGLE_SHEETS_ID=1A2B3C4D5E6F7G8H9I0J1K2L3M4N5O6P
VITE_GOOGLE_SHEETS_SERVICE_ACCOUNT={full-json-content-here}

Common Google Sheets Issues

Problem Cause Solution
"Permission denied" Sheet not shared with service account Share sheet with service account email
"Spreadsheet not found" Wrong sheet ID Copy correct ID from URL
"Invalid range" Column headers don't match Match column names to code
No data appears API key not enabled Enable Google Sheets API in console

📱 Twilio SMS Integration Deep Dive

What is Twilio?

Twilio sends SMS text messages. When a booking comes in, the customer gets a text confirmation immediately.

What Customers Receive via SMS

ProAir HVAC: Thanks for booking AC Repair! We got your request.
Our team will call you at 555-123-4567 within 1 hour.
Confirmation details: bit.ly/hvac-confirm

Complete Setup Steps

1 Sign Up for Twilio
  • Go to https://www.twilio.com/console
  • Create free account
  • Verify phone number (they text you)
  • Complete verification
2 Get Twilio Credentials
  • Go to https://www.twilio.com/console
  • Dashboard shows:
    • Account SID (looks like: ACxxxxxxxxxxxxxxxxxxxxx)
    • Auth Token (looks like: your-auth-token-here)
  • Copy both values
3 Get Twilio Phone Number

Two Options:

Option A: Free Trial Number (Limited)

  • Twilio gives you a free trial number during signup
  • Can only send to verified phone numbers
  • Great for testing

Option B: Buy Dedicated Number ($1/month)

  • Go to https://www.twilio.com/console/phone-numbers
  • Click "Get Started"
  • Choose number (pick area code of your service area)
  • Pay $1/month to use it
  • Now you can send to ANY number
4 Save Configuration

Add to your .env.local:

VITE_TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxx
VITE_TWILIO_AUTH_TOKEN=your-auth-token-here
VITE_TWILIO_PHONE=+12025551234

Common Twilio Issues

Problem Cause Solution
"Permission denied" Credentials wrong Check Account SID and Auth Token
SMS doesn't arrive On trial, number not verified Verify phone in Twilio console first
Wrong number Twilio number not set Set Twilio phone number in config
Invalid recipient Formatting wrong Use full format: +15551234567

🔄 How Each Integration is Invoked

The Complete Trigger Chain

Customer Submits Form ↓ Validate Data ↓ Send HTTP POST to Backend ↓ Backend Receives Request POST /webhook/hvac ↓ Call All 4 Integrations in Parallel ├─ sendToSlack(data) ├─ sendToGmail(data) ├─ sendToSheets(data) └─ sendToTwilio(data) ↓ Return Result to Frontend ✅ "Booking received!"

Backend Invocation Code (Example)

// server.js (Express backend)
app.post('/webhook/hvac', async (req, res) => {
  const { name, phone, email, service, lastServiced, urgency } = req.body;

  try {
    // Start all integrations in parallel
    await Promise.all([
      // 1. Send to Slack
      slack.chat.postMessage({
        channel: process.env.SLACK_CHANNEL_ID,
        text: `🔔 New booking: ${name} - ${service} (${urgency})`
      }),

      // 2. Send to Gmail
      nodemailer.createTransport({...}).sendMail({
        to: email,
        subject: 'Booking Confirmed',
        html: emailTemplate(name, service, phone)
      }),

      // 3. Add to Google Sheets
      sheetsAPI.spreadsheets.values.append({
        spreadsheetId: SHEETS_ID,
        range: 'Sheet1!A:F',
        values: [[
          new Date().toLocaleString(),
          name,
          phone,
          service,
          urgency,
          email
        ]]
      }),

      // 4. Send SMS via Twilio
      twilio.messages.create({
        from: TWILIO_NUMBER,
        to: phone,
        body: `Thanks for booking! We'll contact you soon.`
      })
    ]);

    res.json({ success: true, message: 'Booking processed' });

  } catch (error) {
    console.error('Integration error:', error);
    res.status(500).json({ error: 'Processing failed' });
  }
});

✅ Testing Each Integration

Test All Four Integrations

Complete Integration Test Checklist:

  • Open website in browser
  • Fill out booking form completely
  • Submit form
  • Wait 30 seconds for all integrations to process
  • Check Slack: Message in #hvac-bookings channel? ✅
  • Check Gmail: Email in inbox (check spam folder too)? ✅
  • Check Google Sheets: New row added to spreadsheet? ✅
  • Check SMS: Text message received on phone? ✅
If all 4 pass: Fully operational! 🎉 Your HVAC booking system is ready for customers.

🔧 Troubleshooting Guide

Integration Doesn't Work - Diagnosis Steps

1 Check Backend Logs

See what errors occurred when the form was submitted:

# Terminal - see error messages
tail -f logs/error.log

# Or watch console output
npm run dev
# Look for error messages when submitting form
2 Verify Each Credential

Test each credential individually:

# Test Slack token
curl -H 'Authorization: Bearer YOUR_TOKEN' \
  https://slack.com/api/auth.test

# Test Gmail (try sending email manually)

# Test Sheets (try editing manually)

# Test Twilio
curl -u 'SID:TOKEN' \
  https://api.twilio.com/2010-04-01/Accounts/SID

Common Error Messages & Fixes

"undefined token" error

Cause: Environment variable not set

Fix: Check `.env.local` has all credentials and restart server

"Channel not found"

Cause: Bot not in channel or wrong ID

Fix: Invite bot manually to #hvac-bookings channel

"Permission denied"

Cause: Service account not shared with sheet

Fix: Open sheet → Share → Add service account email

"Invalid phone number"

Cause: Phone format wrong for Twilio

Fix: Use format: +15551234567