> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/guides/integrations/salesforce.md).

# Salesforce

[Salesforce](https://www.salesforce.com/ap/) is a cloud-based CRM platform used by businesses to manage customer relationships, sales, and marketing.

With the [Email Sandbox for Salesforce](https://appexchange.salesforce.com/appxListingDetail?listingId=4f6cce1b-4943-4b23-94d7-d01df5249b03) add-on, you can route your Salesforce emails through [Email Sandbox](https://mailtrap.io/email-sandbox/) to test and inspect them before they reach real recipients.

In this guide, you'll learn how to:

* [Install the Email Sandbox add-on](https://docs.mailtrap.io/guides/integrations/salesforce#step-1.-install-the-email-sandbox-add-on)
* [Connect and authorize Salesforce](https://docs.mailtrap.io/guides/integrations/salesforce#step-2.-connect-and-authorize-salesforce)
* [Activate the Email Sandbox add-on](https://docs.mailtrap.io/guides/integrations/salesforce#step-3.-activate-email-sandbox-for-salesforce)

<details>

<summary><strong>Pricing</strong></summary>

The add-on is free to use with a free Mailtrap account. You get the standard Mailtrap Free plan limits: 50 test emails per month, 1 email per 10 seconds, 1 user and 1 sandbox.

To go beyond these limits, upgrade to a paid Mailtrap plan and add the Salesforce add-on, billed monthly per Salesforce user. A paid plan lets you:

* Test more emails each month, up to unlimited
* Send at higher speed
* Create more sandboxes
* Invite your team to your Mailtrap account
* Get priority support, plus SSO on the Enterprise plan

Additionally, there are available [discounts for non-profit organizations and open-source initiatives](https://docs.mailtrap.io/account-and-organization/billing/non-profit-and-open-source).

</details>

{% hint style="info" %}
The add-on works with Sales Cloud, Service Cloud, Experience Cloud and platform email, including Flow, Apex, email alerts and templates. It doesn't work with Marketing Cloud.
{% endhint %}

## Step 1. Install the Email Sandbox add-on

{% @arcade/embed flowId="pBqMHghFzHxD8ixTY5hT" url="<https://app.arcade.software/share/pBqMHghFzHxD8ixTY5hT>" %}

* Open the official [Mailtrap Email Sandbox AgentExchange listing](https://appexchange.salesforce.com/appxListingDetail?listingId=4f6cce1b-4943-4b23-94d7-d01df5249b03), click **Get It Now**, and log in via Trailblazer.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FUhJKkdIhA1Ykn0ore8Hq%2FScreenshot%202026-09-29%20at%2015.33.29.png?alt=media&amp;token=0cdbd3c7-5de8-4107-8e60-94c554d4219f" alt=""><figcaption></figcaption></figure></div>

* Choose where to install the package&#x20;

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FdxJMNKvWqQJUOUCnTxv5%2FScreenshot%202026-09-29%20at%2015.35.37.png?alt=media&amp;token=5395472d-a611-41e3-aa54-807606452a34" alt=""><figcaption></figcaption></figure></div>

* Confirm the installation details and make sure to accept the terms and conditions

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FskmsnElWquVx9jdioSuG%2FScreenshot%202026-09-29%20at%2015.35.20.png?alt=media&amp;token=0ad4b3fa-8c52-4109-acbb-d1ca7993198a" alt=""><figcaption></figcaption></figure></div>

* Choose a Salesforce username (i.e., **<user123456@agentforce.com>**)&#x20;

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F8txtKURKaYsK068uqw4p%2FScreenshot%202026-09-29%20at%2015.36.59.png?alt=media&amp;token=194de2b0-24c3-4d7e-98dd-a8d1be5b549b" alt="" width="563"><figcaption></figcaption></figure></div>

* Select whether to install the app for admins only, all users, or specific profiles.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FJmtMQaxNjQAI1j2R6bzn%2FScreenshot%202026-09-29%20at%2015.36.41.png?alt=media&amp;token=312355b3-5160-4bf8-8174-c83d73b59a8f" alt=""><figcaption></figcaption></figure></div>

* Approve third-party access and click **Continue**.&#x20;

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FDxarc3YLesqOmPOb5Vk4%2FScreenshot%202026-09-29%20at%2015.37.22.png?alt=media&amp;token=656d84b2-86d4-453a-9bf8-7d934a6a9604" alt="" width="563"><figcaption></figcaption></figure></div>

If the installation takes longer, Salesforce will email you a confirmation.&#x20;

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FpXVGscyJ2KIWUNPPt6vw%2FScreenshot%202026-09-29%20at%2015.49.28.png?alt=media&amp;token=16794c77-9e01-41a7-9a07-96cdd26355df" alt=""><figcaption></figcaption></figure></div>

You can also check for the **RWMailtrapApp** under **Installed Packages**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FfkM2ODiaDMudxhGTgJ2l%2FScreenshot%202026-09-29%20at%2015.51.04.png?alt=media&amp;token=040b2efd-576f-4f49-a11d-5c289aebb36d" alt=""><figcaption></figcaption></figure></div>

## Step 2. Connect and authorize Salesforce

Email Sandbox for Salesforce requires a [Named Credential](https://help.salesforce.com/s/articleView?id=xcloud.named_credentials_about.htm\&type=5) called **MailTrap\_To\_SF** to communicate with your Salesforce org. To set it up, you need to:

* [Assign permission set](https://docs.mailtrap.io/guides/integrations/salesforce#assign-permission-set)
* [Create Named Credentials](https://docs.mailtrap.io/guides/integrations/salesforce#create-named-credentials)
* [Add access to the Named Credentials](https://docs.mailtrap.io/guides/integrations/salesforce#add-access-to-the-named-credentials)

{% hint style="info" %}
**Useful link**: [What are Named Credentials?](https://help.salesforce.com/s/articleView?id=xcloud.nc_basics.htm\&type=5)
{% endhint %}

### Assign permission set

{% @arcade/embed flowId="hzXq7EtgAGGHVI0cJknW" url="<https://app.arcade.software/share/hzXq7EtgAGGHVI0cJknW>" %}

First, you need to assign Mailtrap Admin permission set to User who will configure the app.

* In **Setup** go to **Users** (under **Administration**) and open the **Users** settings. Then, select the user you want running this whole configuration, or the system administrator.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FNFp2hSJzEfrGm0HNI9Hh%2FScreenshot%202026-10-07%20at%2011.56.20.png?alt=media&amp;token=0476ad40-3792-4f53-89b3-095764a3ecbb" alt="" width="563"><figcaption></figcaption></figure></div>

* Under the **Permission Set Assignments** list, click on **Edit Assignments**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FE8lHZUNzNfw6vuGFcJV9%2FScreenshot%202026-10-07%20at%2011.57.14.png?alt=media&amp;token=f242dac0-666f-4cef-95e5-c656bed61282" alt=""><figcaption></figcaption></figure></div>

* Select **MailTrap Admin** and hit the **Save** button.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FSzeHo1MACZ2kYrI9mmfY%2FScreenshot%202026-10-07%20at%2011.57.38.png?alt=media&amp;token=ad43b1da-f577-4839-83fa-24688cac9d8a" alt=""><figcaption></figcaption></figure></div>

### Create Named Credentials

#### Step 1. Create an External Client App

{% @arcade/embed flowId="MZsHAOSVkEVG0zUuJ3zA" url="<https://app.arcade.software/share/MZsHAOSVkEVG0zUuJ3zA>" %}

* Navigate to **Setup** → **Apps** → **External Client Apps** → **External Client App Manager** and click on **New External Client App**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FCnBKzVLPYgXcHKL6NU0D%2FScreenshot%202026-10-07%20at%2017.09.28.png?alt=media&amp;token=da9a2b88-9335-4a0f-9164-a520f336ed4c" alt=""><figcaption></figcaption></figure></div>

* Then, enter the required **Basic Information**, such as **External Client App Name**, **API Name**, **Contact Email**, and **Distribution State**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2Fo0UMl3aofzAntIYJ6zWB%2Fstep%205.png?alt=media&amp;token=0fa903eb-7d7e-477c-9ea8-d3aca1551664" alt=""><figcaption></figcaption></figure></div>

* Next, make sure to check the **Enable OAuth** box and configure it with the following settings:
  * **Callback URL** – For now, use `https://www.example.com` (we will change it later);
  * **OAuth Scopes** – Select **Manage user data via APIs (api)** and Perform **requests at any time (refresh\_token, offline\_access)**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F3Rhjj4s3jlD0xZTvRm7m%2Fstep%206.png?alt=media&amp;token=6ebabba1-964f-4efd-bc5f-52e24f36e3ae" alt=""><figcaption></figcaption></figure></div>

* Under **Flow Enablement**, tick the **Client Credentials Flow** and hit the **Create** button.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FwkX500gozqgCidoVNbGT%2FScreenshot%202026-10-07%20at%2017.11.06.png?alt=media&amp;token=76fdba6f-dfe7-4c1c-bf52-8a4b7ac4af6c" alt=""><figcaption></figcaption></figure></div>

* Under the **Policies** tab, click **Edit**. This will allow you to make the required changes to **OAuth Policies**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FLfuaht9vWl8kk9Imdcbu%2FScreenshot%202026-10-07%20at%2017.12.23.png?alt=media&amp;token=dde3b2b3-fb15-4242-b616-05ef499010be" alt=""><figcaption></figcaption></figure></div>

* Enable **Client Credentials Flow** and enter the email address of the **Admin User** with **MailTrap Admin permission** set assigned.
* Hit the **Save** button.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FM7332J2SAwFp44N7Wnr8%2FScreenshot%202026-10-07%20at%2017.13.11.png?alt=media&amp;token=d0842097-d27c-45d2-b654-b5fc19173f9b" alt=""><figcaption></figcaption></figure></div>

* Go to the **Settings** tab, expand the **OAuth Settings**, and click on **Consumer Key and Secret**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F5iJd0aVyZJKV9yPgWLQy%2FScreenshot%202026-10-07%20at%2017.16.41.png?alt=media&amp;token=0f23eee8-9ed9-491c-bd71-6f15874a97aa" alt=""><figcaption></figcaption></figure></div>

* You will be redirected to a page where you can see your **Consumer Key** and **Consumer Secret**, you should copy both of them.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F6xv0ZFT0ybswTUfWIxgW%2FScreenshot%202026-10-07%20at%2017.17.59.png?alt=media&amp;token=2e26619a-e597-437b-a66e-5d3256c34114" alt=""><figcaption></figcaption></figure></div>

#### Step 2. Create Auth Provider

{% @arcade/embed flowId="R2peujh8cGq038DFp5uP" url="<https://app.arcade.software/share/R2peujh8cGq038DFp5uP>" %}

{% hint style="info" %}
**Useful links**:

* [Configure a Salesforce Authentication Provider](https://help.salesforce.com/s/articleView?id=xcloud.sso_provider_sfdc.htm\&type=5)

* [My Domain (for finding your domain URL)](https://help.salesforce.com/s/articleView?id=xcloud.domain_name_overview.htm\&type=5)
  {% endhint %}

* Navigate to **Setup** → **Identity** (Under **Settings**) → **Auth.Providers** and click on **New**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FzHj6TEun3KggaCWJC6E5%2FScreenshot%202026-10-07%20at%2017.23.49.png?alt=media&amp;token=2cfce44b-0a99-4ba7-b32f-19f5e050738b" alt=""><figcaption></figcaption></figure></div>

* Then, enter the following settings for **Auth. Provider**:
  * For **Provider Type**, select **Salesforce**.
  * For **Consumer Key** and **Consumer Secret** you should paste from the **Connected App**.
  * Paste ***api refresh\_token offline\_access*** in **Default Scopes**.
  * **Authorize Endpoint URL**: Your domain URL + `/services/oauth2/authorize`
  * **Token Endpoint URL**: Your domain URL + `/services/oauth2/token`

{% hint style="info" %}
Domain URL can be found under Company Settings → My Domain.
{% endhint %}

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FQtOlyKQDm7GViMPFviPX%2Fstep%2013.png?alt=media&amp;token=28ef40be-a650-4559-826d-c8b5034597e9" alt=""><figcaption></figcaption></figure></div>

* Copy **Callback URL** from **Auth.Providers**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FB1wBZE7ksRKVvbYPNs2J%2FScreenshot%202026-10-07%20at%2017.24.48.png?alt=media&amp;token=15de59be-3a7b-46ee-b45d-6c18042c75d3" alt=""><figcaption></figcaption></figure></div>

* Paste the **Callback URL** into the **Connected App** instead of `https://www.example.com`.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FfdD3AOigEP2SpfZy1lCX%2FScreenshot%202026-10-07%20at%2017.26.27.png?alt=media&amp;token=e0fb41b3-3c70-4661-b06e-87946f548183" alt=""><figcaption></figcaption></figure></div>

#### Step 3. Named Credentials to Salesforce

{% @arcade/embed flowId="JRDIhh5xmjdiE2iQGnGJ" url="<https://app.arcade.software/share/JRDIhh5xmjdiE2iQGnGJ>" %}

{% hint style="info" %}
**Useful links**:

* [External Credentials](https://help.salesforce.com/s/articleView?language=en_US\&id=sf.nc_create_edit_external_credential.htm\&type=5)

* [Enable External Credentials Principals](https://help.salesforce.com/s/articleView?id=xcloud.nc_enable_ext_cred_principal.htm\&type=5)
  {% endhint %}

* Navigate to **Setup** → **Named Credentials** (under **Security**)→ click on **External Credentials** and hit the **New** button.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FtwwVz2BFFvOQ8iKsYabF%2FScreenshot%202026-10-07%20at%2017.27.28.png?alt=media&amp;token=3b794481-8758-45c8-8256-2603ce3c93ad" alt=""><figcaption></figcaption></figure></div>

* Then, fill in all necessary information:
  * **Name**: MailTrap\_To\_SF
  * **Authentication Protocol**: OAuth 2.0
  * **Authentication Flow Type**: Browser Flow
  * **Scope**: api refresh\_token offline\_access
  * **Identity Provider**: select the Auth.Provider you created – `ThisOrg`

Once you’re done, make sure to hit the **Save** button.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FyUI98deeWVBGBW80QHBF%2F2.png?alt=media&amp;token=1d062fc5-09ef-413d-a791-bcd4be765804" alt=""><figcaption></figcaption></figure></div>

* Navigate to **Named Credentials**, click **New**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FMLbClSsraB8S58BAbep4%2FScreenshot%202026-10-07%20at%2017.29.11.png?alt=media&amp;token=242625c5-ed39-41aa-adf9-e627baf78a75" alt=""><figcaption></figcaption></figure></div>

* Fill in all necessary information:
  * **Label and Name**: MailTrap\_To\_SF
  * **URL**: Your domain URL
  * **External Credential**: select External Credential you created before – MailTrap\_To\_SF
  * **Allowed Namespaces for Callouts**: RWMailtrap

{% hint style="danger" %}
Name should specifically be **MailTrap\_To\_SF**, no other can be used for MailTrap package.
{% endhint %}

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F6usC2R2qyYQ7J0VMLeeR%2F4.png?alt=media&amp;token=4e378e59-fb0e-4e50-ae11-195d250ab09f" alt=""><figcaption></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2Fw4iLMQLqKH6xdiHpx5nK%2F5.png?alt=media&amp;token=951d60c6-58bc-4835-86e7-98f7e0238884" alt=""><figcaption></figcaption></figure></div>

* Once you’re done, click **Save**, and go back to the **External Credentials** tab to open it.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2Fxh5luW3ZBOiFvqHslUVO%2FScreenshot%202026-10-07%20at%2017.29.53.png?alt=media&amp;token=afcfb302-516f-4561-b117-6007dd760b62" alt="" width="563"><figcaption></figcaption></figure></div>

* In the **Principals** section click **New**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F22Pu3NOfZRfdAf9d7Qac%2FScreenshot%202026-10-07%20at%2017.32.21.png?alt=media&amp;token=b43ac91b-c7f1-4105-9fec-884added3743" alt=""><figcaption></figcaption></figure></div>

* Configure it as in the screenshot below, then click **Save**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FCXPF4hQIYOHXsiofT37b%2F8.png?alt=media&amp;token=6bc8366c-0d84-4569-a951-566ee5342376" alt=""><figcaption></figcaption></figure></div>

* In the **Principals** section click the menu button underneath **Actions**:

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FIOv9cbfgwaSNXeFrrGvJ%2F9.png?alt=media&amp;token=82332b4f-527d-436c-aeb8-d0212fa5a99c" alt=""><figcaption></figcaption></figure></div>

* Then, **Authenticate**:

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F3dBo7AkqLr7EFmgsrXIj%2FScreenshot%202026-10-07%20at%2017.33.09.png?alt=media&amp;token=5c99954d-5719-4fa0-a64f-60ba056d323a" alt="" width="250"><figcaption></figcaption></figure></div>

* Login to the Salesforce organization, **Allow** access, and confirm.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FUcBEAeTp3TC8Xf7LDAPP%2F11.png?alt=media&amp;token=7f29e72a-7695-438f-9675-e5bc68ad79ac" alt="" width="362"><figcaption></figcaption></figure></div>

* Go to the **Profiles** page and find the profile you want to give permissions to.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FVpjk83rjZsUXMxTw3MTj%2FScreenshot%202026-10-07%20at%2017.36.24.png?alt=media&amp;token=014faca1-1973-4924-8eaa-99bd804129e7" alt=""><figcaption></figcaption></figure></div>

* At the **Enabled External Credential Principal** **Access** section click **Edit**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FUqS3Fd3JUrQiirCoqoIF%2FScreenshot%202026-10-07%20at%2017.37.45.png?alt=media&amp;token=974c8d3e-248c-4c68-8549-01a180da3a6f" alt=""><figcaption></figcaption></figure></div>

* Select **MailTrap\_To\_SF – 1** and click **Save**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FjoBgJjZwpd7K4XTQu41f%2F14.png?alt=media&amp;token=bccda93a-69f9-49c1-85ff-fbeace9a1a5f" alt=""><figcaption></figcaption></figure></div>

And that’s it, your application is ready!

## Step 3. Activate Email Sandbox for Salesforce

{% @arcade/embed flowId="F7ti6g7iNkm6fhVAACeM" url="<https://app.arcade.software/share/F7ti6g7iNkm6fhVAACeM>" %}

To enable the Email Sandbox for Salesforce, you need to connect your Mailtrap account by adding a [Mailtrap API Token](https://docs.mailtrap.io/email-api-smtp/setup/api-tokens). To do this:

* First, navigate to the Mailtrap app via **App Launcher**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2F9d8gyuuqjOQf2tp2SZ0F%2FScreenshot%202026-10-07%20at%2017.39.35.png?alt=media&amp;token=b3f6ba6a-9a55-4c33-99de-57e0f1f13fb7" alt=""><figcaption></figcaption></figure></div>

* Then, click on **Connect Mailtrap account**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FGrasFzWxw3SmClaXLHYt%2F2.png?alt=media&amp;token=8e03e201-dcae-43ec-a824-5bc5b2bda76a" alt=""><figcaption></figcaption></figure></div>

To activate the Sandbox mode, navigate to **Account Settings**, and then:

* Paste your API token in the bar, hit **Save**.

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FmJ7JOdhGpnglzoisxAY3%2FScreenshot%202026-10-07%20at%2017.43.36.png?alt=media&amp;token=15ae3039-683b-450f-a1d4-4cfb9d1d43a7" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Important**: The Mailtrap API token you intend to use for the Salesforce integration with Sandbox should have:

* At least **Viewer** permission for *the whole account*.
* **Admin** permission for *one or multiple sandboxes*.

If your API token doesn’t meet one of these requirements, you won’t be able to activate the add-on.
{% endhint %}

* Select a sandbox to receive emails
* Activate the sandbox mode

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FJAweTywhe1ZaoYHmS2nv%2FScreenshot%202026-10-07%20at%2017.46.05.png?alt=media&amp;token=ac46ff31-d591-44a1-a4af-75188861f4d7" alt=""><figcaption></figcaption></figure></div>

The integration is complete! 🎉

## Sending a test email

To verify the integration, go to the **Contacts** page and try to send an email to one of your contacts. For example:

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FRmLx6skJqZUajhFvf2Rn%2FScreenshot%202026-10-07%20at%2017.48.17.png?alt=media&amp;token=e552dcb2-4beb-4114-b2db-a0b0df51597e" alt=""><figcaption></figcaption></figure></div>

If you’ve followed everything correctly so far, once you click on **Send**, an email should arrive in your Sandbox, just like so:

<div align="left" data-with-frame="true"><figure><img src="https://365478608-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkNigAKiqQtQub1GOdjY%2Fuploads%2FOEybhOJIqbihaSYOTcML%2FScreenshot%202026-10-07%20at%2017.48.42.png?alt=media&amp;token=197b6ecd-36ab-4f06-9e4f-3adf0054d88f" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mailtrap.io/guides/integrations/salesforce.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
