This page will introduce you to the basics of creating new Email Message or Template records with Dynamic Variables in Engage.
Creating Emails and Templates in Engage - The Basics
You may already be familiar with the basics of creating email messages or templates from the Engage help pages. If you haven't read it already, start reading here. An important thing to remember is that emails can be created by pasting, typing, or uploading HTML, which can then be edited - or by using an existing Template, which may have editable areas. If the template has no editable areas, it is simply used to create new emails with no changes to send out repeatedly, but it may have been built with Dynamic Content in its HTML.
Getting Dynamic Content Into an Email/Template
There are a number of ways to get dynamic content into an email or template.
- You can paste HTML that contains pre-written dynamic content in the Code View when creating an email or template.
- You can hand-write HTML containing dynamic content in the Code View (also from the Paste HTML option) for an email or template.
- You can upload HTML containing pre-written dynamic content to create an email or template.
- You can choose to create an email from a template with one or more editable areas, and paste or type dynamic content into the editable area(s). Keep in mind that, as explained in Dynamic Text Blocks, Operands, and Conditional Statements, if/then statements and similar complex dynamic scripting functions must be surrounded by <dynamic> tags, but basic calls to individual dynamic variables do not.
- You can use the dynamic content button in an email or template to select dynamic variables to add to Messages.
As discussed in the Engage help pages about basic email creation, if you post HTML or any other text into an email/template Code View or an email editable area, do not post text created in Microsoft Word or other document that applies formatting to text. Post only in unformatted text, to prevent errors.
NOTE: The plain text on the Create Email Message page will need to reflect the dynamic code in the HTML email if you want it to have dynamic sections. (You may want the Plain Text to rely on non-dynamic copy.) Plain text on an email is saved automatically only upon first Save of the HTML email - after that, you must edit the plain text email manually. The Plain Text email should be hand-edited to verify that all required dynamic code characters exist in the email, as there is the risk of the transfer from HTML to Plain Text misinterpreting dynamic operands with < and >.
Most email clients have the ability to view both HTML and plain text emails, often from a menu option on each email. When you preview an email by sending it in the context of a subscriber or in a test campaign send (discussed later in this article), you should check out the HTML and Plain Text versions to verify they render properly.
Dynamic HTML Tags
Dynamic block statements should be surrounded by HTML <dynamic> tags:
This will prevent the HTML editor used for emails and templates from formatting the dynamic content as regular HTML content. Dynamic content blocks, therefore, only appear in the HTML source view of an email or in the editable section of an email Template.
Scripts will work and process without the <dynamic> tags, but they may display incorrectly in the WYSIWYG HTML editor.
Using the Add Dynamic Content Button
The Engage help pages linked above includes information about using the Add Dynamic Content button. This can be found in the Code View of an email or template created by Paste or Upload, or the Message Editor window of an email created using a Template. If you have clicked into an editable area of an email created from a Template, there will also be a gear icon that acts as an Add Dynamic Content button.
This button provides a dropdown of Message Attributes, Subscriber Attributes, Dynamic Links, and Branding categories, and a second dropdown allowing selection of any variable stored for those categories.
Several of the most important variables included in the Add Dynamic Content dropdown are the Dynamic Link variables for opening the user Preferences web page, Opt Out links of multiple types, and links to view the email as a web page.
Testing Your Dynamic Content
The email preview and test send buttons from within the Message creation pages are meant solely for previewing layout and format of emails, not for review of dynamic content in the context of individual subscribers.
If you want to see how an email would actually work in the context of a subscriber, you can create a campaign and a campaign send, and attach the email to the send. From the Content step of the Send wizard, you can use the Dynamic Preview and Testing function to select a subscriber to use contextually for dynamic values, and an email address to send the test email to. The Test Send will go to your selected email address with values for dynamic variables pulled from the contextual subscriber.
This will allow you to see any dynamic variables and script in action as if for a real subscriber - but it will help if you know the values for the subscriber you're using as an example. Either use a subscriber you have created and know values for, or look up the details of the contextual subscriber in the Subscribers tab of the Lists & Subscribers page.