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

Mastering CASE Statement in Salesforce Marketing Cloud (SFMC SQL)

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

๐Ÿ“ง Creating & Sending a Test Email in Salesforce Marketing Cloud (SFMC)