Mailgun Inspect for Salesforce is a native Salesforce package that adds email preview capabilities to the Marketing Cloud Next email preview experience. Once connected, you can preview how your email templates render across 100+ email clients and devices — including dark mode variants — without leaving Salesforce.
This guide covers getting access, installing the package, configuring the integration, and running your first preview.
Before you begin
Before setting up the integration, confirm the following:
Salesforce requirements
- Salesforce edition: Enterprise or Unlimited Edition (Lightning Experience)
- Supported Salesforce products: Marketing Cloud Next email experiences that use the Lightning Email Template / Email Content Builder (for example, emails created in CMS Workspaces and previewed in the Marketing Cloud Next Content app)
- Admin access: A Salesforce system administrator must install the Mailgun Inspect managed package and assign the Mailgun Admin/User permission sets
⚠️ Mailgun Inspect integrates with the Lightning-based email builder used by Marketing Cloud Next. Although the same builder framework also appears in Sales Cloud, Service Cloud, and Account Engagement, Mailgun Inspect currently surfaces only in Marketing Cloud Next.
Mailgun Inspect for Salesforce is currently available only in Marketing Cloud Next email experiences that use the Lightning Email Template / Email Content Builder (for example, from a CMS Workspace preview).
If you're unsure which platform you're on, confirm that you have Marketing Cloud Next enabled and that you're creating emails from the Marketing Cloud Next apps before proceeding.
Mailgun requirements
- A Mailgun account with access to Mailgun Inspect
- A Mailgun API key from your account dashboard
Getting access
How you get started depends on whether you already have a Mailgun account.
New customers
Mailgun Inspect is a paid product. If you don't have a Mailgun account, you'll need to get in touch with our sales team before configuring the integration.
- Find the Mailgun Inspect listing on Salesforce AppExchange and click Get It Now or Contact Us.
- A Mailgun sales representative will follow up to discuss your use case, walk you through available plans, and provision your account.
- Once your account is active, return to this guide to complete the configuration steps.
Mailgun Inspect plans start at $4,500/year for 50,000 previews. Your sales representative can help you choose the right plan based on your expected preview volume.
Existing Mailgun customers
If you already have a Mailgun account, you may be able to use it with the Salesforce integration. Check whether your current plan includes Mailgun Inspect access. If you're not sure, or if you need to upgrade, contact your Mailgun account representative — Sales can help you enable access quickly.
Once Inspect is active on your account, you're ready to configure the integration using your existing Mailgun API key.
Step 1: Install the package from AppExchange
A Salesforce system administrator must complete this step.
We recommend installing the package in a Salesforce sandbox or Developer Edition org first, then validating functionality before deploying to production.
- Log in to Salesforce as a system administrator.
- Open the Mailgun Inspect listing on AppExchange and click Get It Now.
- Choose the target org (sandbox or production) when prompted.
- On the installation options screen, select Install for Admins Only — this lets you complete configuration and testing before enabling access for your marketing team.
- Complete the installation and wait for the confirmation email from Salesforce.
If installation fails with an error that includes uiPreviewMessageTabDef, see Troubleshooting below.
Step 2: Assign permissions
After installation, assign the Mailgun permission sets to the appropriate users in your org.
- In Salesforce, go to Setup → Permission Sets.
- Locate the two permission sets installed with the package: Mailgun Admin and Mailgun User.
- Assign permissions based on each user's role:
- Salesforce administrator: assign Mailgun Admin. This gives access to the Mailgun Configuration tab to enter and manage the API key.
- Marketing operations: assign Mailgun Admin or Mailgun User, depending on whether they need configuration access or only preview access.
- Marketer / content creator: assign Mailgun User. This allows them to run Inspect on templates and review results.
Note: Mailgun Admin grants access to the Configuration page and the ability to update the API key. Mailgun User grants access to run previews but does not include configuration access.
Step 3: Get your Mailgun API key
Before you can connect the integration, you'll need a Mailgun API key.
- Log in to your Mailgun account at app.mailgun.com.
- Navigate to Account Settings → API Security.
- Click Create Key, give it a descriptive name (for example, Salesforce Integration), and copy it immediately — the key is only shown once at creation.
⚠️ Your Mailgun API key grants broad API access to your account. Never share it publicly or store it in unsecured locations. Restrict access to the Mailgun Configuration page to administrators only.
ℹ️ If you have a Mailgun EU account, make sure you're copying the key from the correct region. Using a US key with an EU account (or vice versa) will cause the connection to fail.
Step 4: Connect your Mailgun account
With your API key in hand, you're ready to connect Mailgun Inspect to your Salesforce org.
- In Salesforce, open the Mailgun app and navigate to the Mailgun Configuration tab.
- Paste your API key into the Mailgun API key field.
- Click Verify Key.
- Wait for the integration to connect and confirm the number of email clients loaded. A Connection ready status indicates the integration is working.
If the connection fails, check the following:
- Confirm the API key is active and was copied correctly from the right Mailgun region (US or EU).
- Go to Setup → Remote Site Settings in Salesforce and confirm that Mailgun_US_API or Mailgun_EU_API (depending on your region) is enabled.
- If your org has outbound network restrictions, confirm that the Mailgun API endpoint is not being blocked.
Step 5: Preview an email template
Once a Salesforce admin has verified the API key and assigned the appropriate Mailgun permission sets, end users do not need to do any additional configuration — the Mailgun Inspect tab will appear automatically inside the email template preview dialog.
- In Salesforce, navigate to the Marketing Cloud Next app and open the email you want to preview.
- Open an existing email template or create a new one.
- Click the Preview button on the template.
- Select the Mailgun Inspect tab in the preview dialog.
- Your previews can now be generated, showing how the template renders across supported email clients and devices, including dark mode variants.
- Click any thumbnail to view a full-resolution preview. Use the forward and back arrows to navigate between clients.
- After making edits to your template, return to the preview and click Re-run preview to regenerate all previews with your latest changes.
Troubleshooting
Installation fails with uiPreviewMessageTabDef error
This error indicates that Marketing Cloud Next is not fully enabled in your org. Enable Marketing Cloud Next in your Salesforce org settings and retry the installation.
API key verification fails
- Confirm the key is active and associated with the correct Mailgun region (US or EU).
- Check that the appropriate Remote Site setting (Mailgun_US_API or Mailgun_EU_API) is enabled under Setup → Remote Site Settings.
- Check whether your org has firewall or proxy rules that may block outbound connections to Mailgun's API endpoints.
Users can't see the Mailgun Inspect tab
- Confirm the user has either the Mailgun Admin or Mailgun User permission set assigned.
- Confirm that the API key has been successfully verified in the Mailgun Configuration tab — the tab will only appear once the connection is established.
Preview templates appear blank or don't load
- Confirm the template contains email content and has been saved before running Inspect.
- Check that the API key is still active and hasn't been revoked or rotated.
Frequently asked questions
Do I need Salesforce Marketing Cloud Next specifically?
Yes — Mailgun Inspect currently integrates only with Marketing Cloud Next email experiences. Although the same Lightning Email Template Builder framework is also used in Sales Cloud, Service Cloud, and Account Engagement (Pardot), Mailgun Inspect does not currently surface in those products.
What Salesforce edition do I need?
Mailgun Inspect for Salesforce supports Enterprise and Unlimited Editions. Other editions can install managed packages from AppExchange in general, but are not supported for this integration.
Can I install the package in a sandbox before going to production?
Yes, and we recommend it. Install and validate in a sandbox first, then deploy to production once you've confirmed everything is working.
Does Mailgun Inspect change my email templates?
No. Mailgun Inspect reads your template content to generate previews but does not modify your templates, sending configuration, or any Salesforce data.
What data is sent to Mailgun when I run a preview?
The rendered HTML of your email template is sent to Mailgun to generate previews. No Salesforce credentials, user data, or CRM records are transmitted. The integration authenticates using only your Mailgun API key.
Who handles support — Mailgun or Salesforce?
For questions about the Mailgun Inspect package, API key setup, preview results, or billing, contact Mailgun Support. For questions about Salesforce platform behavior (installation errors unrelated to the package, AppExchange account issues, Lightning Email Template access), contact Salesforce Support.
How many email clients and devices are supported?
Mailgun Inspect supports 100+ email clients and devices in the current version, including desktop, mobile, and dark mode variants.
How do I know when I'm running low on previews?
Usage tracking within Salesforce is planned for a future release. In the meantime, you can monitor your preview consumption in the Mailgun dashboard. If you expect high preview volume, discuss tier options with your Mailgun representative during onboarding.