🚨 CRITICAL: Fixed deployment blockers by adding missing core directories: **Community System (CRITICAL)** - includes/community/ - Login_Handler and all community classes - templates/community/ - Community login forms **Certificate System (CRITICAL)** - includes/certificates/ - 8+ certificate classes and handlers - templates/certificates/ - Certificate reports and generation templates **Core Individual Classes (CRITICAL)** - includes/class-hvac-event-summary.php - includes/class-hvac-trainer-profile-manager.php - includes/class-hvac-master-dashboard-data.php - Plus 40+ other individual HVAC classes **Major Feature Systems (HIGH)** - includes/database/ - Training leads database tables - includes/find-trainer/ - Find trainer directory and MapGeo integration - includes/google-sheets/ - Google Sheets integration system - includes/zoho/ - Complete Zoho CRM integration - includes/communication/ - Communication templates system **Template Infrastructure** - templates/attendee/, templates/email-attendees/ - templates/event-summary/, templates/status/ - templates/template-parts/ - Shared template components **Impact:** - 70+ files added covering 10+ missing directories - Resolves ALL deployment blockers and feature breakdowns - Plugin activation should now work correctly - Multi-machine deployment fully supported 🔧 Generated with Claude Code Co-Authored-By: Ben Reed <ben@tealmaker.com>
3.7 KiB
3.7 KiB
Zoho CRM Integration Setup Guide
Overview
This integration syncs WordPress Events Calendar data with Zoho CRM, mapping:
- Events → Campaigns
- Users/Trainers → Contacts
- Ticket Purchases → Invoices
Setup Steps
1. Create Zoho OAuth Application
- Go to Zoho API Console
- Click "CREATE NEW CLIENT"
- Choose "Server-based Applications"
- Fill in details:
- Client Name: HVAC Community Events Integration
- Homepage URL: Your WordPress site URL
- Authorized Redirect URIs:
- For setup script:
http://localhost:8080/callback - For WordPress admin:
https://your-site.com/wp-admin/edit.php?post_type=tribe_events&page=hvac-zoho-crm
- For setup script:
- Click "CREATE" and save your Client ID and Client Secret
2. Generate Credentials Using Setup Script
The easiest way to set up credentials:
cd wp-content/plugins/hvac-community-events/includes/zoho
php setup-helper.php
Follow the prompts to:
- Enter your Client ID and Client Secret
- Open the authorization URL in your browser
- Grant permissions and copy the authorization code
- The script will automatically:
- Exchange the code for tokens
- Get your organization ID
- Create the
zoho-config.phpfile
3. Alternative: Manual Setup
If you prefer manual setup:
-
Create
zoho-config.phpfrom the template:cp zoho-config-template.php zoho-config.php -
Generate authorization URL:
https://accounts.zoho.com/oauth/v2/auth? scope=ZohoCRM.settings.all,ZohoCRM.modules.all,ZohoCRM.users.all& client_id=YOUR_CLIENT_ID& response_type=code& access_type=offline& redirect_uri=http://localhost:8080/callback -
Exchange code for tokens using cURL:
curl -X POST https://accounts.zoho.com/oauth/v2/token \ -d "grant_type=authorization_code" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET" \ -d "redirect_uri=http://localhost:8080/callback" \ -d "code=YOUR_AUTH_CODE" -
Get organization ID:
curl -X GET https://www.zohoapis.com/crm/v2/org \ -H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" -
Update
zoho-config.phpwith your credentials
4. WordPress Admin Setup
After creating the config file:
- Go to WordPress Admin → Events → Zoho CRM
- The integration will automatically detect your configuration
- Click "Test Connection" to verify
- Click "Create Custom Fields" to set up required fields in Zoho
Required Permissions
The integration needs these Zoho CRM scopes:
ZohoCRM.settings.all- For creating custom fieldsZohoCRM.modules.all- For reading/writing recordsZohoCRM.users.all- For user informationZohoCRM.org.all- For organization details (optional)
Security Notes
- NEVER commit
zoho-config.phpto version control - Keep your refresh token secure
- The integration automatically handles token refresh
- All API calls are logged for debugging (disable in production)
Troubleshooting
Common Issues
-
"Invalid Client" Error
- Verify Client ID and Secret are correct
- Ensure redirect URI matches exactly
-
"Invalid Code" Error
- Authorization codes expire quickly (< 1 minute)
- Generate and use immediately
-
"No Refresh Token" Error
- Make sure
access_type=offlinein auth URL - Include
prompt=consentto force new refresh token
- Make sure
Debug Mode
Enable debug logging in zoho-config.php:
define('ZOHO_DEBUG_MODE', true);
define('ZOHO_LOG_FILE', WP_CONTENT_DIR . '/zoho-crm-debug.log');
Check the log file for detailed API responses.
Support
For issues or questions:
- Check the debug log
- Verify credentials in Zoho API Console
- Ensure all required modules are enabled in Zoho CRM