---
url: >-
  https://docs.corbitaltech.dev/products/fblead-addon-for-whatsmarks-saas/configuration.md
description: >-
  Configure Facebook Lead Ads integration with WhatsApp automation in WhatsMark
  SaaS
---

# Configuration Guide

Learn how to configure the FB Lead Addon to capture leads from Facebook and automatically send them to WhatsApp.

## Overview

Configuration involves three main steps:

1. Select Facebook Lead Forms
2. Create WhatsApp message templates
3. Map form fields to message variables

## Step 1: Select Lead Forms

### Connect Your Lead Forms

1. Navigate to **Addons** > **FB Lead Addon** > **Lead Forms**
2. Click **Add New Form**
3. Select the Facebook Page containing your lead ad
4. Choose the Lead Form you want to integrate
5. Click **Connect Form**

### Review Form Fields

After connecting a form:

1. The addon automatically detects all form fields
2. Review the field list to understand available data
3. Common fields include: name, email, phone, company, message

## Step 2: Create WhatsApp Templates

### Message Template Structure

WhatsApp Business requires pre-approved message templates for initial contact. Create templates that will be sent to new leads.

1. Go to **WhatsApp Templates** in the addon settings
2. Click **Create New Template**
3. Design your template with these components:

**Template Example:**

```
Hello {{name}}!

Thank you for your interest in {{product_name}}. We received your inquiry and a team member will contact you shortly.

Your Details:
- Email: {{email}}
- Phone: {{phone}}

We typically respond within 24 hours. For urgent inquiries, call us at +1-555-0123.

Best regards,
Team WhatsMark
```

### Submit Template for Approval

1. Click **Submit for WhatsApp Review**
2. Wait for approval (typically 24-48 hours)
3. Check approval status in the Templates section

## Step 3: Map Form Fields to Template Variables

### Create Field Mappings

Field mapping connects Facebook form data to WhatsApp template variables.

1. Navigate to **Field Mappings** tab
2. Click **Create Mapping**
3. Select the Lead Form and WhatsApp Template
4. Map each variable:

| Template Variable | Facebook Field |
|------------------|----------------|
| `{{name}}`       | Full Name      |
| `{{email}}`      | Email Address  |
| `{{phone}}`      | Phone Number   |
| `{{product_name}}`| Static Text or Form Field |

### Static Values

You can also use static values for variables that don't come from the form:

* **Product Name**: Enter fixed text
* **Company Name**: Your business name
* **Support Contact**: Your support phone/email

### Default Values

Set default values for optional fields:

```
{{company_name|Default: Not Provided}}
```

If the lead doesn't provide a company name, "Not Provided" will be used.

## Step 4: Configure Automation Rules

### Set Delivery Preferences

1. Go to **Automation Settings**
2. Configure these options:

**Send Timing:**

* Immediate (recommended)
* Delayed by X minutes
* Business hours only

**Retry Logic:**

* Retry failed messages: Yes/No
* Max retry attempts: 1-5
* Retry interval: 5-60 minutes

### Lead Filtering

Filter which leads receive automated messages:

1. Enable **Lead Filters**
2. Add conditions:
   * Phone number contains country code
   * Email is not empty
   * Custom field equals specific value

**Example Filter:**

* Only send if phone number starts with "+1"
* And email contains "@"

## Step 5: Test the Configuration

### Send Test Lead

1. Click **Test Configuration**
2. Enter sample lead data
3. Click **Send Test Message**
4. Verify message delivery in WhatsApp

### Review Test Results

Check the test results panel:

* Message sent successfully
* Template variables populated correctly
* Message received on WhatsApp
* No errors in delivery log

## Step 6: Activate Automation

Once testing is complete:

1. Toggle **Automation Status** to **Active**
2. Confirm activation in the popup dialog
3. Monitor the dashboard for incoming leads

## Advanced Configuration

### Multiple Templates Per Form

You can send different templates based on lead characteristics:

1. Create multiple templates
2. Set up conditional rules:
   * If lead source = "Facebook Ad A" → Send Template 1
   * If lead source = "Facebook Ad B" → Send Template 2

### Follow-up Sequences

Configure automated follow-up messages:

1. Enable **Follow-up Messages**
2. Create sequence:
   * Day 1: Welcome message
   * Day 3: Check-in message
   * Day 7: Offer/promotion message

### Webhook Integration

For advanced users, integrate with external systems:

1. Enable **Webhooks** in settings
2. Enter your webhook URL
3. Select events to trigger webhook:
   * New lead received
   * Message sent
   * Message delivered
   * Lead responded

## Configuration Checklist

Before going live, verify:

* \[ ] Lead form(s) connected successfully
* \[ ] WhatsApp template approved
* \[ ] Field mappings configured correctly
* \[ ] Test message sent and received
* \[ ] Automation rules set appropriately
* \[ ] Filters configured (if needed)
* \[ ] Automation status set to Active

## Next Steps

* Monitor lead capture in the [Dashboard](#)
* Review [FAQ](./faq) for common questions
* Set up reporting and analytics
* Configure additional lead forms
