Creating a Code Snippet,External Content And Enhanced Dynamic Content Email in SFMC
Creating a Code Snippet Email in SFMC
๐ Step 1: Navigate to Code Snippet
Go to:
Content Builder → Create → Code Snippet
๐ This is used to create custom HTML emails with full control.
๐ป Step 2: Add Your HTML Code
- Paste your HTML code
- Left panel → Code
- Right panel → Preview
๐ก Real-time preview helps you debug instantly.
๐ Step 3: Check Your Output
Focus on these:
- ✅ Layout alignment
- ✅ Button working
- ✅ Personalization (FirstName etc.)
- ✅ No broken images
⚡ Step 4: Save & Use
- Click Save
- Use inside:
- Email Templates
- Journey Builder
- Campaign Sends
Steps to Create Enhanced Dynamic Content in SFMC
๐น Step 1: Navigate to Upload
- Go to Content Builder
- Click: Content → Upload → Enhanced Dynamic Content
This is where you begin creating dynamic content using a CSV file.
๐น Step 2: Upload CSV File
- Upload your file (e.g., bikes.csv)
- SFMC will automatically process and store it as Enhanced Dynamic Content
๐ก This content can now be reused inside email templates to deliver personalized messages at scale.
๐น Step 3: Data Preparation & Mapping
Once uploaded, you’ll see a screen like this:
| Primary Key | Enhanced Dynamic Content Name | Sample Content | Create As |
|---|---|---|---|
| BikeType | Classic 350 | ||
| ImageURL | https://images.unsplash.com/photo-1605559424843-9e4c228a9c3f | ||
| Description | Experience timeless legacy with the Royal Enfield Classic 350, %%Name%% |
✅ What to Do Here:
- Set Primary Key →
BikeType
๐ This connects content with subscriber data - Verify Column Mapping
ImageURL→ ImageDescription→ Text
- Check Content Types
Ensure all fields are correctly recognized (Text/Image/HTML)
๐น Step 4: Select Audience Data Source
Choose how SFMC will match content with users:
✔ Data Extension (Recommended)
- Map with a field like
PreferredBike
✔ Or Profile Attributes (less flexible)
๐น Step 5: Review & Import
- Review all mappings carefully
- Click Import
๐ Your Enhanced Dynamic Content is now ready to use!
๐ How It Works in Real Campaign
If your Data Extension has:
| Name | PreferredBike |
|---|---|
| John | Himalayan |
| Rahul | Classic 350 |
Then:
- sees Himalayan content
- Rahul sees Classic 350 content
All from one single email template ✅
How to Use External Content in Salesforce Marketing Cloud (SFMC)
External Content in Salesforce Marketing Cloud allows you to pull real-time data from APIs or external URLs directly into your emails—making your campaigns dynamic and highly engaging.
In this guide, you’ll learn step-by-step how to set it up ๐
๐ Step 1: Create a External Content
Content Builder → Create → External ContentCode Snippet
Step 2: Configure External Content Settings
๐น Add URL
Enter your API or external content link (must be HTTPS)
๐น Retrieval Method
You’ll see two options:
1️⃣ Immediately
- Fetches content instantly
- Used for preview/testing
2️⃣ Send Time
- Fetches content when the email is sent
- Ensures real-time data
๐น Retrieval Options
Email Level (Default)
- Same content for all users
Subscriber Level
- Personalized content per user
- Useful for dynamic APIs (user-specific data)
๐น Failure Protocol
Choose how SFMC behaves if API fails:
✔ Continue with Send (Recommended)
- Email still gets delivered
❌ Stop Send Immediately
- Email send fails if API fails
Step 3: Add API / External Link & Preview
- Paste your API URL
- Click Preview / Refresh
๐ If the API returns:
- HTML → renders properly ✅
- JSON → shows raw data ❌ (needs AMPscript)
๐พ Step 4: Save and Use in Email
- Click Save & Exit
- Use this content in your email template
⚠️ Important Tips (Must Know)
- Always use HTTPS URLs
- External Content block works best with HTML responses
-
For JSON APIs, use:
-
HTML Block + AMPscript (
HTTPGet())
-
HTML Block + AMPscript (




Comments
Post a Comment