How to Create a Dynamic Product Recommendation Email in Salesforce Marketing Cloud (SFMC)

What you will learn: How to create a Salesforce Marketing Cloud email template that populates Digioh-collected product recommendation values dynamically.

If you are setting up a Digioh integration by yourself, we first recommend reading Digioh Integration Basics.

What is required: Your account must be integrated with Salesforce Marketing Cloud using either of the following methods:

After completing the integration with Digioh and ensuring data is passing to the SFMC account, follow these steps to create your dynamic email template in SFMC.

Step 1: Log into your SFMC account, go to the “content builder” option, and select “content builder” from the dropdown list.

salesforce marketing cloud Content builder

Step 2: Go to Create > Email Template. Then choose either the ‘Paste HTML’ or ‘From Existing Template’ option.

Create Email Template in SFMC

In this example, we'll choose the “Paste HTML” option.

Step 3: Go to the ‘Content’ option after creating the template.

Email Content in SFMC

From there, you can add content using ‘Blocks’. Drag and drop blocks as required. You can also use the ‘HTML’ block to create the template UI.

Step 4: Under ‘Advanced Content’ there is an option for ‘Dynamic Content.’ Use this block to dynamically decide when to show the campaign and when not to. You can achieve the dynamic display of the campaign also by using a simple ‘HTML’ block option.

Adding dynamic content to email

Step 5: Let's create Dynamic Content using an HTML block. The example HTML code below will show the product recommendation only if its data is being passed to the SFMC data extension.

%%[ Set @productOneName = product_one_name Set @productOneCategory = product_one_category Set @productOneImage= product_one_image Set @productOnePrice = product_one_price Set @productOneQuantity = product_one_quantity Set @productTwoName = product_two_name Set @productTwoCategory = product_two_category Set @productTwoImage= product_two_image Set @productTwoPrice = product_two_price Set @productTwoQuantity = product_two_quantity ]%%

Product Details

%%[ if not Empty(@productOneName) THEN ]%%
  • Name : %%= v(@productOneName) =%%
  • Category: %%= v(@productOneCategory) =%%
  • Image: %%=%20v(@productOneImage)%20=%%
  • Price: %%= v(@productOnePrice) =%%
  • Quantity: %%= v(@productOneQuantity) =%%
%%[ENDIF]%% %%[ if not Empty(@productTwoName) THEN ]%%
  • Name : %%= v(@productTwoName) =%%
  • Category: %%= v(@productTwoCategory) =%%
  • Image: %%=%20v(@productTwoImage)%20=%%
  • Price: %%= v(@productTwoPrice) =%%
  • Quantity: %%= v(@productTwoQuantity) =%%
%%[ENDIF]%%____________

Here is a PDF breakdown of the HTML

To get more details on the dynamic variables and their usage in SFMC, consult the SFMC documentation for an in-depth overview.

Once the email template is created, go to the “Preview and Test” option to start testing how the template will dynamically look when specific data is passed to it.

Preview and test SFMC email with dynamic content

Finishing touch: Once everything is done, you can start building your Email Journey to automate your sending process.

Consult the SFMC documentation to learn how to successfully create an Email Journey.

Have any questions about creating dynamic email templates in SFMC for product recommendations? Send us an email, and we’ll be glad to help!

Want to get more from Digioh?

Get the playbooks leading brands use to convert more visitors into revenue.

Browse the Playbooks ?

Platform Tour

See what else you can do with Digioh in our self-guided platform tour.

Take the Tour ?

Still Need Help?

Connect with our team for technical help.

Message Support