Dynamical Personalization with Ampscript


Ampscript is a very easy way to personalize emails dynamically in Salesforce Marketing Cloud.

When you have a “Sendable Data Extension”, we are able to populate the data in the fields by adding fieldname between double percentage (%%) signs.

Here is an example;

Let’s say our Sendable DataExtension contains the following records.

CustomerIDFirstName LastNameEmailAddress
2837469MUSTAFAUnlukaracustomer1@domain1.com
7394850JenniferMcKaracustomer2@domain2.com
5748943HUNTERcustomer3@domain3.com
5678674JoeKaracustomer4@domain4.com
3254569MIKEcustomer5@domain5.com

We want to start emails with the following format,

Dear FirstName,

In our data extension, we do not have Proper case for values. Some first name values are missing.

We need to send First names in a proper case, and for the missing values we need to use “Valued Customer” text, instead of sending emails with missing first name.

Here is the Ampscript solution code of the personalization ampscript.

Ampscript Personalization Code

“Valued Customer” is added by IIF statement when the first name value of the customer record is missing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.