Why Connect Salesforce to Inbound Email
Salesforce is built to manage customer relationships, but leads and inquiries often arrive via email before they ever reach your CRM. Manually copying email data into Salesforce is time-consuming and error-prone. JsonHook automates this handoff by converting every inbound email into a structured JSON payload and posting it directly to Salesforce's webhook endpoint.
Connecting your inbound email to Salesforce through JsonHook unlocks a range of high-value automation scenarios:
- Create a new contact record automatically from every inbound inquiry email
- Update deal stages when a prospect replies to a proposal
- Log every customer email as an activity on the correct contact timeline
- Assign leads to sales reps based on keywords in the email body
- Trigger follow-up tasks when a client email includes words like "interested" or "quote"
Salesforce supports Salesforce Platform Events, Flow REST trigger, or Apex REST webhook handler, which makes it a natural target for JsonHook's outbound POST requests. Every email that hits your JsonHook address is parsed within milliseconds and delivered to Salesforce as a clean JSON object — no polling, no manual export, no middleware server to maintain.
Setting Up Salesforce with JsonHook
The following steps walk you through connecting JsonHook to Salesforce. The entire setup typically takes under ten minutes.
- Step 1: Create a Salesforce Connected App with OAuth credentials, or set up a Platform Event to receive inbound webhook data. Alternatively, expose an Apex REST class as a public HTTP endpoint.
- Step 2: In an automation tool (Make or n8n), create a workflow triggered by a JsonHook webhook URL. Add a Salesforce action to create a Lead or Case record.
- Step 3: In JsonHook, create an inbound email address and set the destination to the automation webhook URL. Map
from.addressto the Lead Email field andsubjectto the Subject or Lead Source Description. - Step 4: In Salesforce, set up an assignment rule on Lead or Case objects to route records to the appropriate rep or queue based on the parsed email content.
Once the connection is active, every email sent to your JsonHook address will be automatically parsed and forwarded to Salesforce. You can test the integration by sending a plain-text email to your JsonHook address and verifying that the payload appears in Salesforce within a few seconds.
JsonHook supports Salesforce Platform Events, Flow REST trigger, or Apex REST webhook handler on the Salesforce side, so no additional configuration is needed in Salesforce beyond the steps above. If Salesforce requires header-based authentication for incoming webhooks, add the required headers in the JsonHook endpoint configuration under Advanced Settings.
Automate Salesforce with Email Webhooks
Free tier: 100 emails/month. Set up in minutes.
Get Free API KeyExample Workflow: When an enterprise inquiry email arrives, create a Salesforce Lead and assign it to the correct territory rep
This walkthrough demonstrates one concrete way to use JsonHook with Salesforce. The scenario: When an enterprise inquiry email arrives, create a Salesforce Lead and assign it to the correct territory rep.
When an email matching this scenario arrives, JsonHook parses the raw SMTP message and constructs the following JSON payload before POSTing it to your Salesforce endpoint:
{
"messageId": "",
"from": {
"name": "Jane Smith",
"address": "[email protected]"
},
"to": [
{ "address": "[email protected]" }
],
"subject": "When an enterprise inquiry email arrives, create a Salesforce Lead and assign it to the correct territory rep",
"text": "Hi, I need help with my account. Please contact me at your earliest convenience.",
"html": "Hi, I need help with my account...
",
"date": "2026-03-15T10:32:00.000Z",
"attachments": [],
"headers": {
"x-priority": "1"
}
}
Salesforce Lead fields: from.address → Email, from.name → LastName / FirstName, subject → LeadSource or Description, text → Description. For Case objects: subject → Subject, text → Description, from.address → SuppliedEmail.
Once Salesforce receives this payload, it can execute any downstream action — whether that is posting a notification, creating a record, updating a field, or triggering an entire multi-step workflow. The key advantage is that the data arrives as structured JSON, so Salesforce never needs to parse raw email text or deal with MIME encoding.
Payload Mapping for Salesforce
JsonHook delivers a consistent JSON schema for every parsed email. The table below shows which JsonHook fields map to the equivalent fields in Salesforce. Use this as a reference when configuring your Salesforce Salesforce Platform Events, Flow REST trigger, or Apex REST webhook handler.
| JsonHook Field | Description | Salesforce Field |
|---|---|---|
from.address | Sender email address | Sender / Contact email |
from.name | Sender display name | Sender / Contact name |
subject | Email subject line | Title / Subject / Name |
text | Plain-text email body | Description / Body / Message |
html | HTML email body | Rich text field / Notes |
date | Timestamp of receipt (ISO 8601) | Created date / Received at |
attachments[n].filename | Attachment filename | File name / Attachment label |
attachments[n].content | Attachment content (base64) | File content / Binary field |
headers.* | Raw email headers | Metadata / Custom properties |
messageId | Unique message identifier | External ID / Deduplication key |
Not every field will be present in every email. Always check for null or missing values before mapping to required fields in Salesforce. For text-only emails, html will be empty; for HTML-only emails, text may be empty or auto-generated from the HTML. The attachments array will be an empty array when no files are attached.
Best Practices for Salesforce Email Integration
Following these best practices will make your Salesforce email integration more reliable, easier to debug, and simpler to scale as your email volume grows.
- Use dedicated addresses per workflow. Create a separate JsonHook inbound address for each distinct Salesforce workflow you want to trigger. This makes routing explicit and avoids a single endpoint becoming a bottleneck for all email types.
- Validate the payload before acting. In Salesforce, add a conditional check at the start of your workflow to confirm that required fields like
from.addressandsubjectare present and non-empty before executing downstream actions. - Test with real emails first. Use JsonHook's delivery log to inspect the raw JSON payload before wiring up Salesforce. Confirm that all the fields you plan to map are actually populated by your email source.
- Handle errors gracefully. Configure Salesforce to catch webhook delivery failures and send an alert. JsonHook will retry failed deliveries, but your Salesforce endpoint should return a 2xx status promptly to acknowledge receipt.
- Keep secrets out of email content. Avoid routing emails that contain passwords, API keys, or PII through workflows unless you have appropriate data-handling controls configured in Salesforce. Use JsonHook's HTTPS delivery to protect data in transit.