Every time a visitor submits the public contact form, iLeben creates aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/scooller/Leben-site/llms.txt
Use this file to discover all available pages before exploring further.
ContactSubmission record and immediately dispatches a CreateSalesforceCaseJob to push it to Salesforce as a Lead. The job runs in the background on the database queue and includes multi-attempt retry logic that handles invalid field errors, OAuth reconnection, and flow-triggered owner errors — all without losing the submission or requiring manual intervention in the common case.
Contact Channels (ContactChannel)
Contact channels define the source context of a submission (for example, a sale inquiry vs. an informational request). TheContactChannel model is synced from Salesforce and surfaced in the Filament panel as color-coded badges on contact submission rows.
Each channel can carry domain_patterns — a list of domain strings that SalesforceCaseMapper uses to automatically resolve the Website field when mapping a lead payload. This means the correct originating website is included in the Salesforce lead without any manual input from the user.
Lead Creation Flow
CreateSalesforceCaseJob skips retries and records an error immediately when OAuth is marked as disconnected and tryAutoReconnect() fails. This prevents the queue from accumulating hundreds of failed retry attempts while the token is genuinely invalid. Once you reconnect from /admin/site-settings, you can re-sync submissions individually from the Filament panel.UTM Mapping
SalesforceCaseMapper maps the following UTM parameters from the fields JSON of the submission to the Salesforce Lead payload:
| Submission Field | Aliases | Salesforce Field |
|---|---|---|
utm_source | lead_source | utm_source__c, Medio_de_Llegada__c |
utm_medium | audiencia, medio_de_llegada | utm_medium__c, Audiencia__c |
utm_campaign | campana, nombre_de_la_campana | utm_campaign__c, Nombre_de_la_Campa_a__c |
utm_content | pieza_grafica | utm_content__c, Pieza_Grafica__c |
utm_term | audiencia | utm_term__c |
utm_site | website, sitio_web, referrer | Website |
utm_source, utm_medium, utm_campaign, and utm_content can be configured in SiteSetting.extra_settings (keys: utm_source_default, utm_medium_default, utm_campaign_default, utm_content_default). These defaults are bypassed for CSV import submissions.
Case vs Lead: Enabling Each Type
Two environment variables independently control whether Leads and/or Cases are created:CreateSalesforceCaseJob reads SF_LEAD_ENABLED (with SF_CASE_ENABLED as a fallback) and exits immediately if both are false. When SF_LEAD_ENABLED=true, the job calls SalesforceCaseMapper::mapLead() and SalesforceService::createLead().
Lead Field Configuration
The following environment variables configure the Salesforce fields used when creating Leads and Cases:| Variable | Purpose |
|---|---|
SF_LEAD_OWNER_ID | Salesforce User ID to assign as lead owner |
SF_LEAD_STATUS | Default lead status (e.g., En Contacto) |
SF_CASE_RECORD_TYPE_ID | Record Type ID for Case creation |
SF_CASE_OWNER_ID | Salesforce User or Queue ID for Case ownership (also used as Lead owner fallback) |
SF_CASE_SOURCE_ID | Case source reference |
SalesforceCaseMapper: Field Resolution
SalesforceCaseMapper::mapLead() resolves each field through ordered alias lists, falling back gracefully when fields are absent. Key behaviors:
Proyect_ID__c(legacy field): Receives the human-readable project name (not the Salesforce ID) for backward compatibility with legacy Salesforce flows that rely on this field.Proyecto__candID_Proyecto__c: Receive the normalized Salesforce ID of the resolved project.Company: Always set to an empty string. The field is required by Salesforce’s Lead object, but iLeben captures B2C consumers without a company affiliation.GenderIdentityandGenero__c: Always default toOTROunless overridden by a field in the submission.- Custom
__cfields (except those in the exclusion list): Values are normalized by replacing spaces with underscores — a legacy compatibility measure for Salesforce picklist values.
Contact Import (CSV Wizard)
The Filament panel provides a CSV import wizard for bulk-loading historical contact submissions. The wizard enforces the following canonical field names and normalizations:Canonical field names and normalization rules
Canonical field names and normalization rules
Field key normalization — all incoming CSV column headers are normalized to lowercase ASCII with underscores (Canonical key:
_) replacing spaces and special characters.Canonical key: rango_renta — any legacy aliases (e.g., rango de renta, renta_liquida) are mapped to rango_renta during import. Existing records with legacy keys can be backfilled with:apellido — the single canonical key for last name. The alias apellidos is merged into apellido during import.Phone normalization — phone numbers are stored as digits only, stripping +, spaces, and all non-numeric characters.UTM enrichment — during import, UTM fields (utm_source, utm_medium, utm_campaign, utm_content, utm_term) are resolved from marketing aliases in the CSV and attached to the submission before the Salesforce sync job is dispatched.Website field resolution and lead source defaults.
Activity Log and Re-sync
EveryContactSubmission record in the Filament panel displays:
salesforce_case_id— the Salesforce Lead ID returned on success.salesforce_case_error— the error message if the last sync attempt failed.salesforce_synced_at— the timestamp of the last sync attempt.salesforce_sync_trigger— whether the sync wasautomatic(queue job on form submit) ormanual(triggered from the panel).
CreateSalesforceCaseJob with syncTrigger = 'manual' for each selected record.