Skip to content

Custom Industry Request Integration

A comprehensive guide for integrating the "Request Custom Industry" feature with your backend systems and business workflows.

📋 Overview

The Custom Industry Request feature allows users to submit requests for industries not currently supported by your Strategic Intelligence Onboarding system. This guide covers multiple integration approaches to handle these requests effectively.

🎯 Quick Integration Options


📊 Data Structure

Every custom industry request captures comprehensive information:

typescript
interface CustomIndustryRequestData {
  industryName: string        // e.g., "Renewable Energy"
  companyName: string         // e.g., "Solar Solutions Inc"
  contactEmail: string        // e.g., "john@solarsolutions.com"
  businessDescription: string // Detailed business model description
  specificNeeds: string       // Intelligence requirements and use cases
  companySize: string         // startup | small | medium | large | enterprise
  urgency: 'low' | 'medium' | 'high' // Priority level
}

🔧 Integration Options

Option 1: Simple API Integration

Best for: Quick setup, existing API infrastructure

typescript
// In IndustrySelectionScreen.tsx
const handleCustomIndustryRequest = async (requestData: CustomIndustryRequestData) => {
  try {
    const response = await fetch('/api/custom-industry-request', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${getAuthToken()}` // if needed
      },
      body: JSON.stringify(requestData)
    })

    if (!response.ok) {
      throw new Error('Failed to submit request')
    }

    const result = await response.json()
    console.log('Request submitted successfully:', result)
    
  } catch (error) {
    console.error('Error submitting request:', error)
    throw error // Let the modal handle error state
  }
}

Backend Example (Node.js/Express):

javascript
// /api/custom-industry-request endpoint
app.post('/api/custom-industry-request', async (req, res) => {
  try {
    const requestData = req.body
    
    // Store in database
    const request = await CustomIndustryRequest.create({
      ...requestData,
      submittedAt: new Date(),
      status: 'pending'
    })
    
    // Send confirmation email
    await sendConfirmationEmail(requestData.contactEmail)
    
    // Notify internal team
    await notifyInternalTeam(requestData)
    
    res.json({ 
      success: true, 
      requestId: request.id,
      message: 'Request submitted successfully' 
    })
    
  } catch (error) {
    res.status(500).json({ 
      success: false, 
      error: 'Failed to process request' 
    })
  }
})

Option 2: Email Notification System

Best for: Simple workflows, email-based processes

typescript
const handleCustomIndustryRequest = async (requestData: CustomIndustryRequestData) => {
  try {
    await fetch('/api/send-notification', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        type: 'custom_industry_request',
        data: requestData,
        recipients: [
          'product@yourcompany.com',
          'sales@yourcompany.com',
          'support@yourcompany.com'
        ]
      })
    })
    
    // Send confirmation to user
    await fetch('/api/send-confirmation', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        email: requestData.contactEmail,
        template: 'custom_industry_confirmation',
        data: requestData
      })
    })
    
  } catch (error) {
    console.error('Error sending notifications:', error)
    throw error
  }
}

Email Template Example:

html
<!-- Custom Industry Request Notification Template -->
<h2>New Custom Industry Request</h2>

<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;">
  <h3>📊 Request Details</h3>
  <p><strong>Industry:</strong> {{industryName}}</p>
  <p><strong>Company:</strong> {{companyName}}</p>
  <p><strong>Contact:</strong> {{contactEmail}}</p>
  <p><strong>Company Size:</strong> {{companySize}}</p>
  <p><strong>Priority:</strong> {{urgency}}</p>
</div>

<div style="background: #fff3cd; padding: 20px; border-radius: 8px; margin: 20px 0;">
  <h3>🏢 Business Description</h3>
  <p>{{businessDescription}}</p>
</div>

<div style="background: #d1ecf1; padding: 20px; border-radius: 8px; margin: 20px 0;">
  <h3>🎯 Intelligence Needs</h3>
  <p>{{specificNeeds}}</p>
</div>

<div style="margin: 30px 0;">
  <a href="mailto:{{contactEmail}}" style="background: #007bff; color: white; padding: 12px 24px; text-decoration: none; border-radius: 4px;">
    Respond to Request
  </a>
</div>

Option 3: Support Ticket Integration

Best for: Existing support systems (Zendesk, Freshdesk, etc.)

typescript
const handleCustomIndustryRequest = async (requestData: CustomIndustryRequestData) => {
  try {
    // Create support ticket
    await fetch('/api/support/tickets', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        subject: `Custom Industry Request: ${requestData.industryName}`,
        description: formatTicketDescription(requestData),
        priority: mapUrgencyToPriority(requestData.urgency),
        type: 'custom_industry_request',
        requester: {
          name: requestData.companyName,
          email: requestData.contactEmail
        },
        customFields: {
          industry_name: requestData.industryName,
          company_size: requestData.companySize,
          business_type: 'strategic_intelligence'
        }
      })
    })
    
  } catch (error) {
    console.error('Error creating support ticket:', error)
    throw error
  }
}

const formatTicketDescription = (data: CustomIndustryRequestData) => {
  return `
Custom Industry Request Details:

Company: ${data.companyName}
Industry: ${data.industryName}
Contact: ${data.contactEmail}
Company Size: ${data.companySize}
Priority: ${data.urgency}

Business Description:
${data.businessDescription}

Specific Intelligence Needs:
${data.specificNeeds}

This request was submitted through the Strategic Intelligence Onboarding system.
  `.trim()
}

const mapUrgencyToPriority = (urgency: string) => {
  switch (urgency) {
    case 'high': return 'urgent'
    case 'medium': return 'normal'
    case 'low': return 'low'
    default: return 'normal'
  }
}

Option 4: Database + Workflow Integration

Best for: Comprehensive tracking, analytics, workflow automation

typescript
const handleCustomIndustryRequest = async (requestData: CustomIndustryRequestData) => {
  try {
    // Store in database with tracking
    const response = await fetch('/api/custom-industry-requests', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        ...requestData,
        submittedAt: new Date().toISOString(),
        status: 'pending',
        source: 'onboarding_system'
      })
    })
    
    const result = await response.json()
    
    // Trigger workflow automation
    await fetch('/api/workflows/custom-industry-request', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        requestId: result.id,
        triggers: [
          'send_confirmation_email',
          'notify_product_team',
          'create_internal_task',
          'schedule_follow_up'
        ]
      })
    })
    
  } catch (error) {
    console.error('Error processing request:', error)
    throw error
  }
}

Database Schema Example:

sql
CREATE TABLE custom_industry_requests (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  industry_name VARCHAR(255) NOT NULL,
  company_name VARCHAR(255) NOT NULL,
  contact_email VARCHAR(255) NOT NULL,
  business_description TEXT NOT NULL,
  specific_needs TEXT NOT NULL,
  company_size VARCHAR(50),
  urgency VARCHAR(20) DEFAULT 'medium',
  status VARCHAR(50) DEFAULT 'pending',
  source VARCHAR(100) DEFAULT 'onboarding_system',
  submitted_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW(),
  assigned_to UUID REFERENCES users(id),
  estimated_completion_date DATE,
  notes TEXT
);

-- Indexes for performance
CREATE INDEX idx_custom_requests_status ON custom_industry_requests(status);
CREATE INDEX idx_custom_requests_urgency ON custom_industry_requests(urgency);
CREATE INDEX idx_custom_requests_submitted_at ON custom_industry_requests(submitted_at);

Option 5: CRM Integration

Best for: Sales-driven organizations, lead tracking

typescript
const handleCustomIndustryRequest = async (requestData: CustomIndustryRequestData) => {
  try {
    // Create lead in CRM (Salesforce, HubSpot, etc.)
    await fetch('/api/crm/leads', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        company: requestData.companyName,
        email: requestData.contactEmail,
        leadSource: 'Strategic Intelligence Onboarding',
        leadType: 'Custom Industry Request',
        industry: requestData.industryName,
        companySize: requestData.companySize,
        description: requestData.businessDescription,
        customFields: {
          intelligence_needs: requestData.specificNeeds,
          request_urgency: requestData.urgency,
          product_interest: 'Strategic Intelligence Platform'
        }
      })
    })
    
    // Create opportunity if high urgency
    if (requestData.urgency === 'high') {
      await fetch('/api/crm/opportunities', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          name: `Custom Industry Development - ${requestData.companyName}`,
          stage: 'Qualification',
          amount: estimateOpportunityValue(requestData),
          closeDate: getEstimatedCloseDate(requestData.urgency),
          description: `Custom industry request for ${requestData.industryName}`
        })
      })
    }
    
  } catch (error) {
    console.error('Error creating CRM records:', error)
    throw error
  }
}

🔄 Workflow Examples

Automated Response Workflow

mermaid
graph TD
    A[User Submits Request] --> B[Store in Database]
    B --> C[Send Confirmation Email]
    C --> D[Notify Product Team]
    D --> E[Create Internal Task]
    E --> F[Schedule Follow-up]
    F --> G[Generate Industry Config]
    G --> H[QA Testing]
    H --> I[Deploy to Production]
    I --> J[Notify Customer]

Escalation Workflow

typescript
const escalationWorkflow = {
  high: {
    notifyWithin: '1 hour',
    respondWithin: '24 hours',
    assignTo: 'senior-product-manager',
    autoCreateOpportunity: true
  },
  medium: {
    notifyWithin: '4 hours',
    respondWithin: '72 hours',
    assignTo: 'product-team',
    autoCreateOpportunity: false
  },
  low: {
    notifyWithin: '24 hours',
    respondWithin: '1 week',
    assignTo: 'support-team',
    autoCreateOpportunity: false
  }
}

📊 Analytics and Tracking

Key Metrics to Track

typescript
interface RequestAnalytics {
  totalRequests: number
  requestsByUrgency: {
    high: number
    medium: number
    low: number
  }
  requestsByCompanySize: {
    startup: number
    small: number
    medium: number
    large: number
    enterprise: number
  }
  topRequestedIndustries: Array<{
    industry: string
    count: number
  }>
  averageResponseTime: number // in hours
  conversionRate: number // requests that became customers
}

Analytics Dashboard Query Examples

sql
-- Most requested industries
SELECT industry_name, COUNT(*) as request_count
FROM custom_industry_requests
WHERE submitted_at >= NOW() - INTERVAL '90 days'
GROUP BY industry_name
ORDER BY request_count DESC
LIMIT 10;

-- Response time by urgency
SELECT 
  urgency,
  AVG(EXTRACT(EPOCH FROM (updated_at - submitted_at))/3600) as avg_response_hours
FROM custom_industry_requests
WHERE status != 'pending'
GROUP BY urgency;

-- Conversion tracking
SELECT 
  DATE_TRUNC('month', submitted_at) as month,
  COUNT(*) as total_requests,
  COUNT(CASE WHEN status = 'completed' THEN 1 END) as completed_requests,
  (COUNT(CASE WHEN status = 'completed' THEN 1 END) * 100.0 / COUNT(*)) as completion_rate
FROM custom_industry_requests
GROUP BY month
ORDER BY month DESC;

🛠 Testing Your Integration

Manual Testing Checklist

  • [ ] Submit request with all fields filled
  • [ ] Submit request with minimal required fields
  • [ ] Test each urgency level (low, medium, high)
  • [ ] Test different company sizes
  • [ ] Verify email notifications are sent
  • [ ] Check database records are created
  • [ ] Test error handling with invalid data
  • [ ] Verify success state displays correctly

Automated Testing Example

typescript
describe('Custom Industry Request Integration', () => {
  it('should successfully submit a complete request', async () => {
    const mockRequest: CustomIndustryRequestData = {
      industryName: 'Renewable Energy',
      companyName: 'Solar Solutions Inc',
      contactEmail: 'test@solarsolutions.com',
      businessDescription: 'Solar panel installation and maintenance',
      specificNeeds: 'Competitor pricing analysis and market trends',
      companySize: 'medium',
      urgency: 'high'
    }

    const response = await fetch('/api/custom-industry-request', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(mockRequest)
    })

    expect(response.status).toBe(200)
    
    const result = await response.json()
    expect(result.success).toBe(true)
    expect(result.requestId).toBeDefined()
  })

  it('should handle validation errors gracefully', async () => {
    const invalidRequest = {
      industryName: '', // Empty required field
      contactEmail: 'invalid-email' // Invalid email format
    }

    const response = await fetch('/api/custom-industry-request', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(invalidRequest)
    })

    expect(response.status).toBe(400)
    
    const result = await response.json()
    expect(result.errors).toBeDefined()
  })
})

🔐 Security Considerations

Input Validation

typescript
const validateRequest = (data: any): CustomIndustryRequestData => {
  const schema = {
    industryName: { required: true, maxLength: 255 },
    companyName: { required: true, maxLength: 255 },
    contactEmail: { required: true, format: 'email' },
    businessDescription: { required: true, maxLength: 2000 },
    specificNeeds: { required: true, maxLength: 2000 },
    companySize: { enum: ['startup', 'small', 'medium', 'large', 'enterprise'] },
    urgency: { enum: ['low', 'medium', 'high'] }
  }
  
  // Validate against schema
  // Sanitize input data
  // Return validated data or throw validation error
}

Rate Limiting

typescript
// Implement rate limiting to prevent spam
const rateLimiter = {
  windowMs: 15 * 60 * 1000, // 15 minutes
  max: 3, // limit each IP to 3 requests per windowMs
  message: 'Too many requests, please try again later.'
}

📞 Support and Troubleshooting

Common Issues

Request not received:

  • Check API endpoint is correct
  • Verify network connectivity
  • Check server logs for errors
  • Validate request format

Email notifications not sent:

  • Check email service configuration
  • Verify recipient addresses
  • Check spam folders
  • Review email template formatting

Database errors:

  • Verify database connection
  • Check table schema matches
  • Review field length limits
  • Check for duplicate constraints

Debug Mode

typescript
const handleCustomIndustryRequest = async (requestData: CustomIndustryRequestData) => {
  const DEBUG = process.env.NODE_ENV === 'development'
  
  if (DEBUG) {
    console.log('Custom Industry Request Debug:', {
      timestamp: new Date().toISOString(),
      data: requestData,
      userAgent: navigator.userAgent
    })
  }
  
  try {
    // ... implementation
  } catch (error) {
    if (DEBUG) {
      console.error('Request failed:', error)
    }
    throw error
  }
}

🚀 Best Practices

Response Time Goals

  • High urgency: Respond within 24 hours
  • Medium urgency: Respond within 72 hours
  • Low urgency: Respond within 1 week

Quality Assurance

  • Always send confirmation emails
  • Set clear expectations for response times
  • Follow up if no response within expected timeframe
  • Track request-to-completion metrics

Customer Experience

  • Provide transparent status updates
  • Offer alternative solutions while custom industry is being developed
  • Consider creating interim configurations for urgent requests

Your Custom Industry Request integration can significantly enhance customer satisfaction and provide valuable market insights for your Strategic Intelligence platform!

Strategic Intelligence Hub Documentation