Connecting to Salesforce
Navigate in the admin panel to: Salesforce > Settings > Connections
Multiple connections can be configured to communicate among various Salesforce Instances, API versions, and authorization types.
Note: Providers are not installed by default. Choose one of the Provider options below.
Providers
A connection provider is responsible for authorizing with the Salesforce API. Salesforce supports various authorization methods; we recommend OAuth.
Option 1: OAuth 2 (recommended)
Download and install our OAuth 2 connection provider. It leverages Patron, our OAuth2 client manager for Craft CMS.
Option 2: Build Your Own
You can build your own connection type to accommodate unique connection requirements.
Step 1 - Implement Interface
Create a new PHP class that implements SavableConnectionInterface
Step 2 - Register Provider
Register the provider so it is available as a connection provider option.
Add the following to your Craft Module/Plugin init()
function.
\yii\base\Event::on(
\flipbox\craft\salesforce\cp\Cp::class,
\flipbox\craft\salesforce\events\RegisterConnectionsEvent::REGISTER_CONNECTIONS,
function (\flipbox\craft\salesforce\events\RegisterConnectionsEvent $event) {
$event->connections[] = <YOUR_CONNECTION_PROVIDER_CLASS>::class;
}
);
Overrides
You can define connection provider overrides via: config/salesforce-connections.php
An example override may look like:
<?php
return [
'<YOUR-CONNECTION-HANDLE>' => [
'version' => 'v45.0'
]
];
Pro-Tip
How to handle Salesforce Sandbox Instances
We insist on using them during development and testing. As your Craft project progresses through environments, configure the connection using Overrides (depending on the connection provider) to update credentials and endpoints.
Which version should I use?
Use the latest most stable version available to your instance. The version must be entered with a lowercase 'v' prefixed to it. Ex: v45.0
.
Here is a handy reference to determine your API Version.
← Support