n8n-nodes-smartemailing-contact-importer
v2.0.0
Published
n8n community nodes for importing contacts to Smartemailing and Facebook Lead Ads integration
Maintainers
Keywords
Readme
n8n-nodes-smartemailing-contact-importer
This n8n community node package provides:
- Smartemailing Contact Importer - Import contacts into Smartemailing contact lists
- Facebook Lead Ads Trigger - Receive real-time leads from Facebook Lead Ads (supports multiple forms)
n8n is a fair-code licensed workflow automation platform.
Installation
Follow the installation guide in the n8n community nodes documentation.
Facebook Lead Ads Multi-Form Trigger
The Facebook Lead Ads Trigger node receives real-time webhook notifications when new leads are submitted through Facebook Lead Ads. Unlike the built-in n8n trigger which only supports one form per Facebook App, this custom trigger can handle multiple lead forms by filtering on Page and Form.
Facebook Lead Ads Credentials
This node uses OAuth2 authentication with Facebook. When you first add the node, you'll be prompted to connect your Facebook account with the following permissions:
leads_retrieval- Required to read lead datapages_show_list- Required to list your pagespages_manage_metadata- Required to subscribe to webhookspages_manage_ads- Required for lead ads accessads_management- Required for lead ads accesspages_read_engagement- Required for page access
Setting Up
- Go to Facebook Developers and create an app (or use existing)
- In n8n, add the Facebook Lead Ads Multi-Form Trigger node
- Click to create new credentials - this will open Facebook OAuth flow
- Grant the required permissions
- Select your Page and Form from the dropdowns (they load automatically!)
Webhook Configuration
You need to configure Facebook to send webhooks to your n8n instance:
- In Facebook Developers, go to your app → Webhooks
- Add a new subscription for Page object
- Configure:
- Callback URL: Your n8n webhook URL (shown in the trigger node)
- Verify Token: The same string you enter in the Verify Token parameter
- Fields: Subscribe to
leadgen
- Subscribe your Facebook Page to the app:
curl -i -X POST "https://graph.facebook.com/{page-id}/subscribed_apps?subscribed_fields=leadgen&access_token={page-access-token}"
Facebook Lead Ads Trigger Parameters
Verify Token
- Required: Yes
- Description: Custom string for webhook verification. Must match the Verify Token configured in your Facebook App webhook settings.
Page Name or ID
- Required: No
- Type: Dropdown (dynamically loaded from your Facebook account)
- Description: Select a Facebook Page to filter leads. Leave as "All Pages" to receive leads from all your pages.
Form Name or ID
- Required: No
- Type: Dropdown (dynamically loaded based on selected Page)
- Description: Select a Lead Form to filter leads. Leave as "All Forms" to receive leads from all forms on the selected page.
Fetch Full Lead Data
- Required: No (default:
true) - Description: When enabled, fetches complete lead data (email, name, custom fields) from the Facebook Graph API. When disabled, only returns the webhook event metadata.
Options
- Graph API Version: The Facebook Graph API version to use (default:
v18.0) - Lead Fields: Comma-separated list of fields to fetch from the lead
Facebook Lead Ads Trigger Output
When a new lead is submitted, the node outputs:
{
"leadgen_id": "123456789",
"page_id": "987654321",
"form_id": "456789123",
"ad_id": "789123456",
"created_time": "2024-01-15T10:30:00+0000",
"emailaddress": "[email protected]",
"name": "John Doe",
"phone": "+1234567890",
"field_data": [
{ "name": "email", "values": ["[email protected]"] },
{ "name": "full_name", "values": ["John Doe"] }
]
}The output is formatted to be directly compatible with the Smartemailing Contact Importer node - just connect them together!
Example Workflow: Facebook Leads to Smartemailing
- Add Facebook Lead Ads Trigger node
- Configure credentials and optional filters
- Copy the webhook URL and configure it in your Facebook App
- Connect to Smartemailing Contact Importer node
- Select your Smartemailing contact list
- Activate the workflow
Smartemailing Contact Importer
Import contacts into Smartemailing contact lists directly from your n8n workflows.
Smartemailing Credentials
This node requires Smartemailing API credentials:
- Username: Your Smartemailing API username
- Password: Your Smartemailing API password (API key)
You can find your API credentials in your Smartemailing account settings under API access.
Parameters
Contact List Name or ID
- Required: Yes
- Type: Dropdown (dynamically loaded from your Smartemailing account)
- Description: Select the contact list where contacts will be imported. You can also specify an ID using an expression.
Contact Data Source
- Required: No (default:
From Input Items) - Type: Options
- Options:
- From Input Items: Use contact data from previous node's output items
- From JSON Parameter: Provide contact data as a JSON array in the parameter below
Contact Data (JSON)
- Required: Yes (only when Contact Data Source is set to
From JSON Parameter) - Type: JSON
- Description: JSON array of contact objects to import. See Contact Data Format below.
Settings
Optional settings for the import process:
- Update (default:
true): Whether to update existing contacts - Add Genders (default:
false): Whether to add genders to contacts - Add Namedays (default:
false): Whether to add namedays to contacts - Add Salutations (default:
false): Whether to add salutations to contacts - Preserve Unsubscribed (default:
true): Whether to preserve unsubscribed status - Skip Invalid Emails (default:
false): Whether to skip invalid email addresses
Double Opt-In Settings
Optional settings for double opt-in email campaigns:
- Email ID: ID of the email to send for double opt-in confirmation
- Sender From: Email address to send from
- Sender Name: Name of the sender
- Sender Reply To: Reply-to email address
- Confirmation Thank You Page URL: URL to redirect to after confirmation
- Send To Mode: Who should receive the double opt-in email
All: Send to all contactsNew Only: Send only to new contacts
- Silence Period Unit: Unit for the silence period (
daysorhours) - Silence Period Value: Value for the silence period (number)
Contact Data Format
When using From Input Items, each input item should be a contact object. The node will automatically:
- Extract contact data from each item's JSON
- If an item has a
dataarray, it will use that array - If an item is itself an array, it will use that array
- Otherwise, it will treat the item as a single contact object
When using From JSON Parameter, provide a JSON array in the following format:
[
{
"emailaddress": "[email protected]",
"name": "John Doe",
"contactlists": [
{
"id": 1,
"status": "confirmed"
}
],
"customfields": [
{
"id": 1,
"value": "Custom value"
}
]
}
]Note: The selected contact list ID will be automatically added to each contact's contactlists array if not already present.
Contact Object Fields
- emailaddress (required): Contact's email address
- name (optional): Contact's name
- contactlists (optional): Array of contact list objects with
idandstatus(confirmedorunsubscribed) - customfields (optional): Array of custom field objects with
idandvalue(oroptionsfor multi-select) - purposes (optional): Array of purpose objects with
id,valid_from, andvalid_to - preferences (optional): Object with
contact_preferencesarray - blacklisted (optional): Set to
1to blacklist the contact
For complete field documentation, refer to the Smartemailing API documentation.
Usage Examples
Example 1: Import from Previous Node
- Connect a node that outputs contact data (e.g., Google Sheets, Database)
- Configure the node to output contact objects with
emailaddressand other fields - Connect to Smartemailing Contact Importer node
- Select the target contact list
- Set Contact Data Source to
From Input Items - Configure import settings as needed
Example 2: Import from JSON
- Add Smartemailing Contact Importer node
- Select the target contact list
- Set Contact Data Source to
From JSON Parameter - Enter JSON array in Contact Data field:
[
{
"emailaddress": "[email protected]",
"name": "User One"
},
{
"emailaddress": "[email protected]",
"name": "User Two"
}
]- Configure import settings as needed
Output
The node returns the response from the Smartemailing API import endpoint, which includes:
- status: Import status (
createdon success) - contacts_map: Mapping of email addresses to contact IDs (empty if double opt-in is used)
- double_opt_in_map: Mapping for double opt-in requests (if applicable)
Resources
- n8n community nodes documentation
- Smartemailing API Documentation
- Facebook Lead Ads API Documentation
- Facebook Webhooks Documentation
Compatibility
- Minimum n8n version: 1.0.0
- Smartemailing API: v3
Version History
1.1.0
- Added Facebook Lead Ads Multi-Form Trigger node
- Receive real-time leads from Facebook Lead Ads
- Dynamic Page and Form dropdowns - just like the built-in trigger!
- Support for filtering by Page and Form (or receive from all)
- OAuth2 authentication with Facebook
- Automatic field mapping for SmartEmailing compatibility
1.0.0
- Initial release
- Import contacts to Smartemailing contact lists
- Support for all import settings and double opt-in configuration
