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 KeyEnhanced Dynamic Content NameSample ContentCreate As
BikeTypeClassic 350
ImageURLhttps://images.unsplash.com/photo-1605559424843-9e4c228a9c3f
DescriptionExperience 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 → Image
    • Description → 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:

NamePreferredBike
JohnHimalayan
RahulClassic 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


Go to:
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())

Comments

Popular posts from this blog

A/B Testing in Salesforce Marketing Cloud (Step-by-Step Guide)

📧 Creating & Sending a Test Email in Salesforce Marketing Cloud (SFMC)

Creating a Personalized Email in Salesforce Marketing Cloud