System Strings

Marketing Cloud includes a library of system-based personalization strings which can be included in a message or on a page to output a value, based on the context of the Subscriber, Contact or a message.

Email Date Strings

NOTE: Date-based personalization strings use the system time (the data center location of your Marketing Cloud account) and appear in US format. However, these values can be transformed using AMPscript date functions.

String Description Example Output
xtmonth Full name of the month when email is sent January
xtmonthnumeric Current month as a number 1
xtday Current day of the month when the email was sent 15
xtdayofweek Current day of the week when the email was sent Monday
xtyear Current year when the email was sent 2018
xtshortdate Current date when the email was sent in short format 01/15/2018
xtlongdate Current date when the email was sent in long format Monday, January 15, 2018

Example

This example will update a date field in a Data Extension with the system time when an email is sent, which can be used as a suppression Data Extension for future sends:

%%[

InsertDE("Sent Subscribers", "Member ID", _subscriberkey, "sent date", xtshortdate)

]%%

Email Data Strings

String Description Example Output
emailname_ Name assigned to the email Spring Newsletter
_emailid The system-defined numeric identifier of the email 33345
_messagecontext

The context in which the Subscriber viewed the message or page. Either:

  • SEND – an email that is sent to a Subscriber
  • PREVIEW – an email that is previewed within the email editor
  • VAWP – an email opened as “view as web page” (from a view_email_url link in an email)
  • FTAF – an email that is sent as a “Forward to a Friend” message
  • LANDINGPAGE – content is viewed on a landing page, microsite page or CloudPage code resource
  • VALIDATION – email is validated using the validation option in Marketing Cloud
  • LINKRESOLUTION – a URL in an email that is resolved as a click-through link
  • SMS – an SMS message that is sent to a Subscriber
  • SOCIAL – email content that is shared using the Social Forward feature
Refer to Description
_replycontent Used in a Triggered Send Email that has been set as the “Triggered send to forward” option in a Sender Profile when Reply Mail Management is configured. Returns the email body that was included in the reply message. Refer to Description
_IsTestSend Resolves to true if the email was sent as a Test Send from Email Studio, otherwise the value is false false
jobid Returns the unique job identifier related to the email send 3210123
_JobSubscriberBatchID A numeric identifier of the batch associated with a Triggered Email; this value defaults to 0 for a List send 5554321
_PreHeader The preheader attribute assigned to the email. This string only returns a value when used in an AttributeValue function. For example, %%=AttributeValue("_PreHeader")=%% 30% off store-wide, this weekend only!
_DataSourceName The value of the List, Group, Sendable Data Extension or Data Extension Filter related to the email send; returns an empty value if the All Subscribers list is used VIP Members
_listname The user-defined list name; returns an empty value if the All Subscribers list is used Loyalty Members

Subscriber Data Strings

String Description Example Output
emailaddr The email address of the Subscriber leon@limedash.com
firstname_ or firstname The Subscriber’s first name from the "FirstName" Subscriber Profile Attribute Leon
lastname_ or lastname The Subscriber’s last name from the "LastName" Subscriber Profile Attribute Green
subscriberid A system-defined numeric identifier representing a Subscriber 1234
_subscriberkey A user-defined unique identifier representing a Subscriber M123456
listid The corresponding list identifier of the Subscriber; returns the All Subscribers list id if the email is not sent to a specific list 12345
list_ The listid value suffixed with an underscore character and the email type (either TEXT or HTML) 12345_HTML
listsubid A system-defined identifier representing the Subscriber’s relationship to the list 987654321
_messagetypepreference The Subscriber’s preferred email type, as defined as in the HTML Emails Attribute in the Subscriber record; either TEXT or HTML HTML

Sender Data Strings

String Description Example Output
replyname The email From name, retrieved from the Sender Information in the Sender Profile, or the selected user profile Limedash Corporation
replyemailaddress The email From email address, retrieved from the Sender Information in the Sender Profile, or the selected user profile marketing@email.limedash.com
memberid The member identifier (MID) of the Business Unit which the email is sent from 6541234
member_busname The "Company Name" value defined for the Business Unit which the email is sent from Limedash Corporation, Inc.
member_addr The "Street Address" value defined for the Business Unit which the email is sent from 4463 Shinn Street
member_city The "City" value defined for the Business Unit which the email is sent from New York
member_state The "State/Province" value defined for the Business Unit which the email is sent from NY
member_postalcode The "Zip/Postal Code" value defined for the Business Unit which the email is sent from 10019
member_country The "Country" value defined for the Business Unit which the email is sent from United States

Email URL Data Strings

String Description Example Output
view_email_url URL to view the email http://view.s6.exacttarget.com/?qs=17f9ecc7fcd5...
ftaf_url URL to a Forward to a Friend form page http://view.s6.exacttarget.com/ftaf.aspx?qs=17f9ecce47fcd...
subscription_center_url URL of the Subscriber’s Subscription Center http://cl.s6.exct.net/subscription_center.aspx?qs=8ecce2c86ef063c...
profile_center_url URL of the Subscriber’s Profile Center http://cl.s6.exct.net/profile_center.aspx?qs=8ecce2c86ef063c31effc761
unsub_center_url URL of the Subscriber’s One-Click Unsubscribe page http://cl.s6.exct.net/unsub_center.aspx?qs=8ecce2c86ef063c3...
double_opt_in_url Inserts a double opt-in link in an email if this feature is enabled http://cl.exct.net/sub_confirm.asp?lst=1234&eml=...

Reply Mail Management Strings

When Reply Mail Management (RMM) is enabled on an account, custom RMM settings can be configured in the sender profile to forward a Triggered Send email to a user or email address, or reply to the Subscriber using a Triggered Send email. This functionality is enabled by checking the ‘Forward using triggered send’ or ‘Reply using triggered send’ options in the sender profile.

Triggered Send emails used for RMM forwarding or replies can contain personalization strings to extract information from the reply email. These personalization strings can be used with AMPscript to customize the email that is forwarded to a user or email address. Additionally, when the ‘Reply using triggered send’ option is used, the Triggered Send email can include information from the Subscribers’ original reply. Use cases for RMM forwarding and replies with Triggered Send emails include:

  • Respond with an acknowledgment email to the Subscriber and a formatted abstract of their reply email, explaining they will receive a response in two business days
  • Send the email to an internal email address and include details of the email that the Subscriber replied to (for example, the email name and related journey)
  • Strip the original email from the reply email thread
  • Log the email reply into a Data Extension
  • Create Tasks or Activities in Sales Cloud from the email reply
  • Identify keywords used in the reply message to conditionally trigger other platform actions


Not a subscriber? Subscribe now.

MobileConnect Data Strings

MobileConnect messages use nouns and verbs. A verb is a keyword used in a Mobile Originated (MO) message. Nouns are strings that appear after the keyword. In the example below, OFFER is the keyword, or verb, of the message and Curt Harris forms the message nouns.

OFFER Curt Harris
String Description Example Output
MOBILE_NUMBER The mobile number of the Contact, prefixed with an area code 17182097651
SHORT_CODE The associated short or long code used to send the message 111322 (short code) or 19172759833 (long code)
MSG(0) The entire message OFFER Curt Harris
MSG(0).VERB The message keyword OFFER
MSG(0).NOUNS The part of the message after the verb Curt Harris
MSG(0).NOUN([n]) Returns the ‘n’ noun in the current message using a zero-based index, (0 returns the first noun, 1 returns the second noun etc.) MSG(0).NOUN(0) = Curt
MMS_CONTENT_URL([n]) Similar to MSG(0) but used for MMS messages. Returns the URL of the MMS content from the incoming MO message, where ‘n’ is the zero-based index of the MMS content contained in the MO message. A value of 0 indicates the MMS content in the current MO message. http://exacttarget.com/mms.aspx?qs=17f9ecce47fcd

Example

This example code is used in a text response template and inserts the message into a Data Extension when a Contact replies to a text response message.


Not a subscriber? Subscribe now.

MobileConnect Contact Data Strings

The following personalization strings represent the MobileConnect Demographic data for a mobile subscriber in Marketing Cloud.

String Description Example Output
_CarrierID Carrier ID 4
_Channel Channel Mobile
_City City Overland Park
_ContactID Contact ID 13197985
_CountryCode Country code US
_CreatedBy The ID of the entity that created the Contact 6387679
_CreatedDate Date the Contact was created 2018-10-01 13:33
_FirstName First name Nora
_IsHonorDST Contact’s time zone honors Daylight Savings Time True or False
_LastName Last name Taylor
_MobileNumber Mobile number 19135551212
_ModifiedBy ID of the entity that last modified the Contact 6387679
_ModifiedDate Date and time the Contact data was last modified 2018-10-02 12:22
_Priority Priority to use when sending a message to the Contact 1
_Source Source of Contact information Mobile Opt-in
_SourceObjectID Internal unique ID of the Contact’s source 2
_State State associated with the Contact KS
_Status Send status of the Contact
  • -1 – Unspecified
  • 1 – Active
  • 2 – Bounced
  • 3 – Held
  • 4 – Unsubscribed
_UTCOffset Number of hours from which the Contact’s time zone deviates from UTC -6
_ZipCode Zip code associated with the Contact 55555

NOTE: CarrierID field values are reportedly incorrect or inconsistent. Use with caution.


Not a subscriber? Subscribe now.

GroupConnect Data Strings

The following strings apply only to GroupConnect messages and cannot be used in other Marketing Cloud applications. Some strings are specific to integration with the LINE messaging application.

String Description Example Output
LINE_ADDRESS_ID Unique LINE ID of a person eliotharper
LINE_JOB_ID Unique LINE job identifier b409facab49447eb8f1d489e5473bf5e
LINE_SUBSCRIBER_ID Corresponding Subscriber identifier in Marketing Cloud 8765432
TEXT The entire message OFFER Lily Baker
VERB The first word in the message OFFER
TEXT.NOUN All words after the verb Lily Baker
TEXT.NOUN([n]) Returns the ‘n’ noun in the current message using a zero-based index, (0 returns the first noun, 1 returns the second noun etc.) MSG(0).NOUN(0) = Lily
STKR.STKPKGID Package ID associated with the specified sticker (for LINE messages containing a sticker) 1234
STKR.STKID ID associated with the specified sticker (for LINE messages containing a sticker) 5678
STKR.STKTXT Text associated with the specified sticker (for LINE messages containing a sticker) happy

Website Data Strings

The following strings apply only to landing pages, microsites and CloudPages and cannot be used in other Marketing Cloud applications.

String Description Example Output
microsite_base_url[default]ID[/default] URL to a microsite landing page. Replace ID with the unique ID value for the landing page. This string is for classic landing pages and does not function in CloudPages. https://pub.s1.exacttarget.com/page.aspx?qs=1550dccf35ce...
PAGEURL URL of current landing page with URL parameters https://pub.s1.exacttarget.com/lcuh4w3abc?subscriber=12345

Email Analytics Strings

String Description Example Output
linkname The value entered in the alias link attribute. If no value is specified, it contains the complete URL. CTA
_ImpressionRegionID Returns the ID of the Impression Region. Contains 0 if there are no active Impression Regions. 1
_ImpressionRegionName Returns the name of the active Impression Region defined in the email. heading
AdditionalInfo_ The value entered into the Additional Info field when sending an email. This value is appended to email links as a URL parameter. This feature requires the Parameter Manager to be enabled in Setup. summeroffer
__AdditionalEmailAttribute[n] The values entered into the Additional Email Attributes fields when sending an email, where [n] is an integer from 1 to 5 (up to five Additional Email Attributes are supported). These values are appended to email links as a URL parameter. This feature requires the Parameter Manager to be enabled in Setup. segment1

Einstein Email Data Strings

The following strings can be used for formatting and sanitizing Einstein Email Recommendation data. These strings differ from other system personalization strings in that they behave similar to a function, where the string value is interpreted based on arguments within the string construct.

String Description Example Output
ImageLink Value of the ‘Image URL’ mapped field in the product catalog https://limedash.com/products/1000100.jpg
ProductName Value of the ‘Product’ mapped field in the product catalog Apex Bionic Jacket
Description Value of the ‘Product Description’ mapped field in the product catalog This coveted soft shell keeps you warm and windchill-free.
RegularPrice Value of the ‘Regular Price’ mapped field in the product catalog 16.99
SalePrice Value of the ‘Sale Price’ mapped field in the product catalog 12.99
RegularPriceMain Outputs the integer part (before the decimal) of the field mapped to RegularPrice or Price for streaming updates 65
SalePriceMain Outputs the integer part (before the decimal) of the field mapped to SalePrice 42
RegularPriceFractional Outputs the fractional part (integer after the decimal) of the field mapped to RegularPrice or Price for streaming updates 99
SalePriceFractional Outputs the fractional part (integer after the decimal) of the field mapped to SalePrice for streaming updates 50
ToFloat Converts the value of a string field in a Catalog to a floating-point number 12.25
[a]LongestWordLength Calculates the longest word in an attribute and outputs the length of that word as a number, where [a] is the attribute For a Description attribute with the string ‘Also available in black’ , %%DescriptionLongestWordLength%% will output 9.
[a]LengthNum Returns the length of a Catalog attribute, where [a] is the attribute For a Description with the string ‘One size only’, %%DescriptionLengthNum%% will output 13.
First[n] Outputs the first characters of value, where [n] is an integer %%SKUFirst5%% will output ABC123
Split[d]At[i] Splits a value and returns the given index, where [d] is the delimiter and [i] is a zero-based index. The delimiter can be longer than one character and the index can be negative. For a Size attribute with the string ‘small;medium;large’ , %%Split;At1%% will output medium.
[a]Replace[r]With[w]End Globally replaces a given string with another string from a Catalog attribute, where [a] is the attribute, [r] is the string to match and [w] is the string to replace For a Color attribute with the string ‘Purple’, %%ColorReplacePurpleWithLavenderEnd%% will output Lavender.
[a]UpTo[n]By[d]With[o]End Outputs the value of a Catalog attribute up to an index with an appended string (if included), where [a] is the attribute, [i] is a whole number of characters to evaluate, [d] is the delimiter and [o] is the optional string into append. Values shorter than the limit output unaltered and values without a delimiter that match within the limit output blank. For a Size attribute with the string ‘small;medium;large’, %%SizeUpTo14By;With~End%% will output small;medium~.

Chaining

When using Einstein Email Data Strings, strings can be chained together into a single string. The example below illustrates that for a ProductName attribute with a value Vintage Cruiser Bike, Vintage is changed to Classic and the product name is displayed in uppercase.


Not a subscriber? Subscribe now.