Overview
This document refers to our salesforce Case Creation and Lead Creation addon (Allow staff users to create leads and cases from discussions and comments.). It does not refer to Salesforce oAuth2 SSO functionality.
Requirements
You must have SSL enabled on your domain. (Your forum must be served over HTTPS).
Features
This addon allows users that have the Staff.Allow
permission to do the following:
- Link your Salesforce account to your Vanilla user profile.
- Create Salesforce cases and leads from Vanilla discussions (per discussion, not per comment).
- Salesforce cases and leads appear as “attachments” on your Vanilla discussion for authorized users.
- View Salesforce leads from Vanilla user profiles.
- Sync Vanilla users with Salesforce contacts when a user edits their profile or registers.
The Vanilla administrator may alternatively setup a global Salesforce connection rather than using individual connections.
We also offer single sign-on from Salesforce.
Setup
Salesforce: Create & Configure Application
- Log into your Salesforce Account
- Create new Connected App in Salesforce.
- Build → Create → Apps → Connected Apps → New
- Fill the required fields: Connected App Name, API Name, Contact Email.
- Enable OAuth Settings.
- Set a Callback URL by appending
/profile/salesforceconnect
to the end of your forum’s URL. - Add to Selected OAuth Scopes:
- Full access (full)
- Perform requests on your behalf at any time (refresh_token, offline_access)
- Save.
Vanilla: Enable & Configure Addon
- Log into your Vanilla forum.
- Dashboard → Addons, and click the Salesforce addon’s settings icon.
- Fill out the requested information.
Where to find your ApplicationID and Secret in Salesforce?
In the app creation section mentioned in under API you will see Consumer Key (which is the ApplicationID) and Consumer Secret (which is the Secret)
Vanilla: Link your account
- Login to Vanilla.
- Go to your profile page.
- Edit your profile.
- Click on the Social section. (/profile/connections)
- Click “Connect” on Salesforce.
- Follow the instructions from there.
Vanilla: Send Profile Extender Fields to Salesforce
To send custom fields over to SalesForce make sure the SalesForceID
field on Vanilla's "Profile Fields" settings is set:
For "Contact Standard Fields" it should match "Field Name" found in your Salesforce.
Would be as below in Vanilla's Profile Field Extender
For "Contact Custom Fields" it should match "API Name" found in your Salesforce.
Would be as below in Vanilla's Profile Field Extender
Usage
Create Cases
Users who have Moderation privileges (Garden.Staff.Allow
) can click on the cog next to a discussion or comment and select "Salesforce - Create Case" to create a case from the content of the post. If the author of the post's email address does not match the email address of any user already stored as contacts in Salesforce, a contact will be created as well.
The data sent automatically from the forum to Salesforce during case creation are:
-
ContactId
: This ID is retrieved from Salesforce via an API query based on the author's email address. If there is no contact for this email address, one is created. -
Status
: The status pick-list values are retrieved from Salesforce via API. -
Origin
: This is set to 'Vanilla'. It can be manually changed in the forum config (Salesforce.OriginValue
, ask your Customer Success Manager). -
Priorit
: The priority pick-list values are retrieved from Salesforce via API. -
Subject
: Defaults to the title on the discussion. Description
: Defaults to the body of the discussion or comment.VanillaForumUrlc
: The URL where the Lead was generated.
Data that the moderator can add to complete the Salesforce record by filling in the Case Creation Form:
-
FirstName
- Vanilla doesn't store First Name or Last Name values so these have to be added by the Moderator. -
FirstName
The payload of the API call will look like this:
{
"ContactId": "115C3Ct7QAF",
"Description": "Charlie Bucket is a poor boy who lives near the Wonka Candy Company. The company's owner,",
"Origin": "Vanilla",
"Priority": "Medium",
"Status": "New",
"Subject": "I have a golden ticket.",
"Vanilla__ForumUrl__c": "https://dev.vanilla.localhost/discussion/41/i-have-a-golden-ticket/p1"
}
When the Case has been successfully created, the post where it was done will display this to moderators only:
Create Leads
Users who have Moderation privileges (Garden.Staff.Allow
) can click on the cog next to a discussion or comment and select "Salesforce - Add Lead" to create a lead from the author of the post. If the author of the post's email address does not match the email address of any user already stored as contacts in Salesforce, a contact will be created as well. If the user's email matches the email of an existing Lead, the form will not render and it will display a "This Lead already exists" message.
The data sent automatically from the forum to Salesforce during case creation are:
-
ContactId
: This ID is retrieved from Salesforce via an API query based on the author's email address. If there is no contact for this email address, one is created. Email
: The email of the author of the comment or discussion. - 'Status': (Salesforce
Status
) The status pick-list values are retrieved from Salesforce via API. -
LeadSource
: This is set to 'Vanilla'. It can be manually changed in the forum config (Salesforce.LeadSourceValue
, ask your Customer Success Manager). Description
: The body of the text of the Discussion or Comment.VanillaForumUrlc
: The URL where the Lead was generated.
Data that the moderator can add to complete the Salesforce record by filling in the Case Creation Form:
-
FirstName
-
LastName
-
Company
-
Title
The payload of the API call will look like this:
{
"Company": "Wonka Candy Company",
"Description": "I have a golden ticket.",
"Email": "willy@wonkafactory.com",
"FirstName": "Willy",
"LastName": "Wonka",
"LeadSource": "Vanilla",
"Status": "Working - Contacted",
"Title": "President",
"Vanilla__ForumUrl__c": "https://myforum.com/discussion/41/i-have-a-golden-ticket/p1"
}
When the Lead has been successfully created, the post where it was done will display this to moderators only:
Troubleshooting
I can’t link my account.
If you get stuck on a page that says “error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration”,
make sure that the URL you are on when you are in the social section of your profile matches the Callback URL that you set in the configuration.
Example: If the URL when you are on in your profile’s social section is https://forum.example.com/somedirectory/profile/connections
, you should have https://forum.example.com/somedirectory/profile/salesforceconnect
in your configuration.