diff --git a/.env.example b/.env.example index 996b95a..a63176d 100644 --- a/.env.example +++ b/.env.example @@ -5,8 +5,17 @@ NODE_ENV=production SERVER_PORT=3001 # Zoho CRM Integration -# Set ZOHO_ENABLED=true to forward leads/support to Zoho CRM -# Get credentials from https://api-console.zoho.com → Self Client +# Preferred current setup: webtolead for contact leads using the legacy Zoho form tokens. +ZOHO_FORWARDING_MODE=webtolead +ZOHO_WEBTOLEAD_ENABLED=false +ZOHO_WEBTOLEAD_URL=https://crm.zoho.com/crm/WebToLeadForm +ZOHO_WEBTOLEAD_XNQSJSDP= +ZOHO_WEBTOLEAD_XMIWTLD= +ZOHO_WEBTOLEAD_ACTION_TYPE=TGVhZHM= +ZOHO_WEBTOLEAD_RETURN_URL=null +ZOHO_WEBTOLEAD_ZC_GAD= + +# Standby REST API/OAuth setup. Set ZOHO_FORWARDING_MODE=api and ZOHO_ENABLED=true to use it. ZOHO_ENABLED=false ZOHO_API_DOMAIN=https://www.zohoapis.com ZOHO_ACCOUNTS_DOMAIN=https://accounts.zoho.com diff --git a/.gitignore b/.gitignore index ac607e1..24fa201 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ FUTURE.md HISTORY.md BUILD_SUMMARY.md SCRIPTS.md +.drop/ +zoho.md + # Dependencies node_modules/ @@ -36,3 +39,4 @@ pnpm-debug.log* .learnings/ Levi.md Queue-North-Website.code-workspace +Working Site.zip diff --git a/Dockerfile b/Dockerfile index bdfdad1..19d5615 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,14 @@ ENV SERVER_PORT=3001 ENV RATE_LIMIT_PER_MINUTE=5 ENV CORS_ORIGIN=* ENV LOG_LEVEL=info +ENV ZOHO_FORWARDING_MODE=webtolead +ENV ZOHO_WEBTOLEAD_ENABLED=false +ENV ZOHO_WEBTOLEAD_URL=https://crm.zoho.com/crm/WebToLeadForm +ENV ZOHO_WEBTOLEAD_XNQSJSDP= +ENV ZOHO_WEBTOLEAD_XMIWTLD= +ENV ZOHO_WEBTOLEAD_ACTION_TYPE=TGVhZHM= +ENV ZOHO_WEBTOLEAD_RETURN_URL=null +ENV ZOHO_WEBTOLEAD_ZC_GAD= ENV ZOHO_ENABLED=false ENV ZOHO_API_DOMAIN=https://www.zohoapis.com ENV ZOHO_ACCOUNTS_DOMAIN=https://accounts.zoho.com diff --git a/assets/Service-Disabled Veteran-Owned-Certified.jpg b/assets/Service-Disabled Veteran-Owned-Certified.jpg new file mode 100644 index 0000000..ce61a94 Binary files /dev/null and b/assets/Service-Disabled Veteran-Owned-Certified.jpg differ diff --git a/assets/Veteran-Owned Certified.jpg b/assets/Veteran-Owned Certified.jpg new file mode 100644 index 0000000..990c0c3 Binary files /dev/null and b/assets/Veteran-Owned Certified.jpg differ diff --git a/docker-compose.yml b/docker-compose.yml index f113cb0..f84ff40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,12 +22,21 @@ services: - RATE_LIMIT_PER_MINUTE=5 - CORS_ORIGIN=https://queuenorth.com - LOG_LEVEL=info - - ZOHO_ENABLED=false - - ZOHO_API_DOMAIN=https://www.zohoapis.com - - ZOHO_CLIENT_ID= - - ZOHO_CLIENT_SECRET= - - ZOHO_REFRESH_TOKEN= - - ZOHO_REDIRECT_URI= + - ZOHO_FORWARDING_MODE=${ZOHO_FORWARDING_MODE:-webtolead} + - ZOHO_WEBTOLEAD_ENABLED=${ZOHO_WEBTOLEAD_ENABLED:-false} + - ZOHO_WEBTOLEAD_URL=${ZOHO_WEBTOLEAD_URL:-https://crm.zoho.com/crm/WebToLeadForm} + - ZOHO_WEBTOLEAD_XNQSJSDP=${ZOHO_WEBTOLEAD_XNQSJSDP:-} + - ZOHO_WEBTOLEAD_XMIWTLD=${ZOHO_WEBTOLEAD_XMIWTLD:-} + - ZOHO_WEBTOLEAD_ACTION_TYPE=${ZOHO_WEBTOLEAD_ACTION_TYPE:-TGVhZHM=} + - ZOHO_WEBTOLEAD_RETURN_URL=${ZOHO_WEBTOLEAD_RETURN_URL:-null} + - ZOHO_WEBTOLEAD_ZC_GAD=${ZOHO_WEBTOLEAD_ZC_GAD:-} + - ZOHO_ENABLED=${ZOHO_ENABLED:-false} + - ZOHO_API_DOMAIN=${ZOHO_API_DOMAIN:-https://www.zohoapis.com} + - ZOHO_ACCOUNTS_DOMAIN=${ZOHO_ACCOUNTS_DOMAIN:-https://accounts.zoho.com} + - ZOHO_CLIENT_ID=${ZOHO_CLIENT_ID:-} + - ZOHO_CLIENT_SECRET=${ZOHO_CLIENT_SECRET:-} + - ZOHO_REFRESH_TOKEN=${ZOHO_REFRESH_TOKEN:-} + - ZOHO_CASES_ENABLED=${ZOHO_CASES_ENABLED:-false} - RECAPTCHA_ENABLED=${RECAPTCHA_ENABLED:-false} - RECAPTCHA_SECRET_KEY=${RECAPTCHA_SECRET_KEY:-} - RECAPTCHA_MIN_SCORE=${RECAPTCHA_MIN_SCORE:-0.5} diff --git a/docs/zoho-setup.md b/docs/zoho-setup.md index a2df5cc..548cc9a 100644 --- a/docs/zoho-setup.md +++ b/docs/zoho-setup.md @@ -1,18 +1,36 @@ # Zoho CRM Setup Guide for Queue North Admins -This guide walks you through setting up Zoho CRM integration to automatically capture leads and support cases from Queue North's website. +This guide walks you through the current Zoho CRM integration. Contact leads use the legacy Zoho WebToLead form tokens, while the OAuth/API integration remains available as a standby option for future lead upserts or support cases. --- -## 🔒 Prerequisites +## Prerequisites Before you begin, ensure you have: - A Zoho CRM account (admin access required) -- Access to Zoho API Console: https://api-console.zoho.com +- The WebToLead hidden field values from the old Zoho form --- -## Step 1: Create a Zoho Self-Client App +## Step 1: Gather WebToLead Values + +The current integration needs the old Zoho form's hidden fields: + +```text +xnQsjsdp +xmIwtLD +actionType +returnURL +zc_gad +``` + +These values are stored locally in `zoho.md`, which is ignored by git. + +--- + +## Optional Standby: Create a Zoho Self-Client App + +Only use these OAuth steps if switching `ZOHO_FORWARDING_MODE=api`. 1. Go to **https://api-console.zoho.com** 2. Click **"Create Self Client"** @@ -29,7 +47,7 @@ Before you begin, ensure you have: --- -## Step 2: Generate an Authorization Code +## Optional Standby: Generate an Authorization Code 1. In the Self Client tab, click **"Generate Code"** 2. Set the **Scope** to: @@ -42,7 +60,7 @@ Before you begin, ensure you have: --- -## Step 3: Exchange Auth Code for Tokens +## Optional Standby: Exchange Auth Code for Tokens Run this `curl` command (replace placeholders): @@ -69,12 +87,27 @@ curl -X POST https://accounts.zoho.com/oauth/v2/token \ --- -## Step 4: Configure Environment Variables +## Step 2: Configure Environment Variables -Add these to your `.env` file: +The current production-friendly setup uses the legacy Zoho WebToLead form tokens for contact leads while keeping the OAuth API integration available as a standby option. + +Add these to your `.env` file for WebToLead lead forwarding: ```env -# Zoho integration is OFF by default — set to true to enable +ZOHO_FORWARDING_MODE=webtolead +ZOHO_WEBTOLEAD_ENABLED=true +ZOHO_WEBTOLEAD_URL=https://crm.zoho.com/crm/WebToLeadForm +ZOHO_WEBTOLEAD_XNQSJSDP=