This guide walks you through the one time setup required in Salesforce and Klaviyo before the integration can go live. Follow each section in order. Sections and steps marked optional can be skipped if you won't use that sync. Skipping any other step will cause the integration to fail.
By the end of this setup, the integration will:
Important: All steps in this guide must be performed by a Salesforce System Administrator. Do not proceed without admin access.
Confirm you have everything below before touching any settings.
The integration reads each Contact's and Lead's country code (the MailingCountryCode field on Contact and CountryCode on Lead) to turn phone numbers into the international format Klaviyo needs. Phone numbers on your Salesforce Contacts and Leads that are saved without a country code, such as (415) 555-0132, can only be read correctly when the country is known. Without these fields, those numbers are skipped, and the sync can fail with an invalid field error.
Salesforce only provides the country code fields once State and Country/Territory Picklists are enabled. To check, go to Setup, search for State and Country/Territory Picklists in Quick Find, and confirm they show as enabled. If not, follow Salesforce's steps on that page to scan, convert and enable them.
The integration reads one email consent field on every Contact, and on every Lead if you sync Leads. It can also read an SMS consent field, if you want SMS consent in sync. Salesforce already has a standard email field, so most orgs only need to make it visible. The SMS field is optional.
Note: The field names in this section (
HasOptedOutOfEmailandSMS_Opt_Out__c) are just examples. Whichever fields your org actually uses, enter their exact API names under Configure Mapping → Consent Field Mapping during setup. The email field is required. The SMS field is optional.
Note: The integration reads the API name of each consent field to decide what a checked box means. A name that contains
OptedOutorOpt_Out(for exampleHasOptedOutOfEmailorSMS_Opt_Out__c) is read as opted out when checked. Any other name (for exampleSMS_Opt_Out__c) is read as opted in when checked. A name without the underscore, such asSMS_OptOut__c, is read as an opt-in field, which reverses the meaning. If that is your field name, rename it or use a different field.
The integration always needs one email consent field to read. Which one you use depends on your org:
HasOptedOutOfEmail field. It exists on both Contact and Lead and is already filled in by default under Consent Field Mapping.Email_Opt_Out__c). Use that one instead and enter its API name under Consent Field Mapping.HasOptedOutOfEmail in place. You can turn Consent Sync off later in Organization Settings.Either way, the field has to be visible to the System Administrator profile:
HasOptedOutOfEmail by default) and open itOnly follow this section if you want SMS consent to sync. If you don't use SMS consent, skip it and leave the SMS field empty under Consent Field Mapping.
If your org already has an SMS consent checkbox, use it. Just make sure it is visible to the System Administrator profile (step 6 below) and enter its API name under Consent Field Mapping. Otherwise, create a new one:
SMS_Opt_Out (Salesforce will add __c automatically)2.1, making it Visible for System AdministratorImportant:
SMS_Opt_Out__cis only an example name. Whatever API name your field actually has, enter that exact name under Configure Mapping → Consent Field Mapping as the SMS consent field. A mismatch between the two will break SMS consent sync.
This step isn't required, but it lets you see a history of changes to consent fields on the Contact (and Lead) record.
Salesforce can send changes to the integration in real time. To set that up, you create a Record-Triggered Flow. The flow watches a record for a change and sends an Outbound Message to the integration.
Every flow in this section is optional. Only create the ones for the syncs you plan to use:
Each flow has two parts: first create the Outbound Message, then create the flow that sends it. You turn the syncs themselves on or off in Organization Settings (see Section 4).
Skip this section if you won't sync Cases. This flow tells the integration when a Case is created, or when its Status, Priority or Escalation changes.
Part A: Create the Outbound Message
Go to Setup, search for Outbound Messages in Quick Find, and click New Outbound Message
Select Case as the object and click Next
Fill in the outbound message details:
Klaviyo_Case_Events_WebhookUnder Case fields to send, select all of the following:
CaseNumber, ClosedDate, ContactEmail, ContactId, ContactPhone, CreatedDate, Id, IsClosed, IsDeleted, IsEscalated, LastModifiedDate, Origin, OwnerId, Priority, Status, Subject, Type
Click Save, then Done
Part B: Create the flow
Go to Setup → Process Automation → Flows and click New Flow
Select Record-Triggered Flow and click Create
Click Add Object and select Case
Under Configure Trigger, select A record is created or updated
Under Set Entry Conditions, set Condition Requirements to Formula Evaluates to True
Paste the following formula into the formula box:
OR(
ISNEW(),
ISCHANGED({!$Record.Status}),
ISCHANGED({!$Record.Priority}),
ISCHANGED({!$Record.IsEscalated})
)
Under When to Run the Flow for Updated Records, select Every time a record is updated and meets the condition requirements
Under Optimize the Flow for, select Actions and Related Records, then click Done
Click the + under the trigger, choose Action, search for Klaviyo Case Events Webhook under Outbound Message, and select it
Set the Label to Send Case Event to Klaviyo and click Done
Click Save and name the flow Klaviyo Case Events Flow
Click Activate
Skip this section if you won't sync consent. This flow tells the integration when a Contact's email or SMS consent changes.
Part A: Create the Outbound Message
Go to Setup, search for Outbound Messages in Quick Find, and click New Outbound Message
Select Contact as the object and click Next
Fill in the outbound message details:
Klaviyo_Contact_Consent_Events_WebhookUnder Contact fields to send, select: Email, Id, Phone, your email consent field, and your SMS consent field
Click Save, then Done
Part B: Create the flow
Go to Setup → Process Automation → Flows and click New Flow
Select Record-Triggered Flow and click Create
Click Add Object and select Contact
Under Configure Trigger, select A record is created or updated
Under Set Entry Conditions, set Condition Requirements to Formula Evaluates to True
Paste the following formula into the formula box:
AND(
NOT(ISBLANK({!$Record.Email})),
OR(
AND(ISCHANGED({!$Record.HasOptedOutOfEmail}), {!$Record.HasOptedOutOfEmail} = TRUE),
AND(ISCHANGED({!$Record.SMS_Opt_Out__c}), {!$Record.SMS_Opt_Out__c} = FALSE)
)
)
Note:
HasOptedOutOfEmailandSMS_Opt_Out__cabove are just examples. They are not real field names you need to use. Replace both with your own org's actual email and SMS consent field API names, the same ones you enter in Consent Field Mapping. Do this in the formula above and in the field list in Part A, step 4.
Note: If you don't use an SMS consent field, remove the SMS line and its
ORwrapper from the formula, so only the email check is left, and leave the SMS field out of the field list in Part A.
Note: The formula above assumes an SMS opt-in field, so it fires when the box is cleared (
= FALSE). If your SMS consent field is an opt-out field, use= TRUEfor that field instead, the same way the email field is written.
Send Contact Consent to Klaviyo and click DoneKlaviyo Contact Consent Events FlowSkip this section unless you sync both Leads and consent. It is the same flow as 3.2, set up on the Lead object, so Lead consent changes reach the integration in real time too.
Klaviyo Lead Consent Events Webhook (unique name Klaviyo_Lead_Consent_Events_Webhook) and the flow Klaviyo Lead Consent Events FlowEmail, Id, Phone, your email consent field, and your SMS consent fieldNote: Endpoint URLs and secret tokens for all outbound messages will be provided by Solvative. Don't save the outbound messages until you have those values.
Once Sections 1 to 3 are done, you're ready to activate the integration.
Open the integration app at the URL provided by Solvative
Sign in, or accept your invite email if it's your first login. Invite links expire after 7 days. Contact Solvative if yours has expired.
Click Connect Salesforce:
Click Connect Klaviyo and approve all requested scopes. The integration needs access to profiles, events, subscriptions and metrics.
On the Configure Mapping screen:
(Optional) Run the Backfill, a one-time import of your existing Contacts, Leads and Cases into Klaviyo. It can only be run once. If you skip it now, you can start it later from Organization Settings. Choose what to import with the toggles on this screen:
Then click Start Backfill, or Skip for now.
Important: The toggles on the Backfill screen only apply to this one-time import. They don't turn on the regular, ongoing sync. To choose which syncs keep running after setup (Leads, Cases, Consent), open Organization Settings and go to Sync Settings. You can reach it from the user menu at the top right, or from the Manage individual syncs link on the dashboard. Change them there any time.
Important: Do not delete the webhook endpoint that gets created automatically in Klaviyo during setup. Deleting it will break real time consent and event sync.
A few rules you should know before the integration goes live:
Important: Never manually override an opt-out in either system without documented proof of re-consent from the customer.
Case events not appearing in Klaviyo
Open Setup → Process Automation → Flows and confirm the Case Events flow shows as Active. Test by editing a Case record and checking whether the outbound message is sent. You can see delivery status under Setup → Outbound Messages.
Consent changes not syncing
Confirm the relevant Consent Events flow (Contact or Lead) is Active. Double check that the consent field API names in the flow's entry formula exactly match the ones entered in Consent Field Mapping.
Sync fails with an invalid field error on MailingCountryCode or CountryCode
This means State and Country/Territory Picklists are not enabled in your Salesforce org. Enable them (see Section 1), then retry.
Outbound Message delivery failures
Confirm the endpoint URL and secret token in all outbound messages match the values Solvative provided. Endpoint URLs are environment specific.
Contact the Solvative project team for any setup or activation issues:
Email: support@solvative.com
Web: www.solvative.com
For Klaviyo specific questions, refer to help.klaviyo.com.
© 2026 Solvative. All rights reserved.