Required Permissions
Deliver Content Blocks
Content Blocks are used to insert HTML content conditionally into Deliver mailings, decision letters, or portals. While translation codes and liquid markup can also be used to insert conditional content into a message, content blocks allow for HTML editing and formatting of the content prior to being merged into the mailing.
Note
The term Content Blocks has replaced what were formerly known as Mailing Snippets in Deliver. The terms are equivalent and may appear in either form throughout Slate documentation. Inbox Snippets are distinct from content blocks.
Possible use cases for content blocks include:
- Staff signatures outside of Inbox
- Blurbs on academic programs
- Images related to academic or extracurricular interest
Content blocks can be used in:
- Deliver Mailings
- Decision Letters
- Portals
- Inbox
- Merge fields on Forms
Important!
Content blocks should not be used to populate the CC, Recipient, and Subject line of mailings. Instead, use translation codes and/or liquid markup.
Example: Declared major
Imagine you'd like to merge relevant content into a mailing that congratulates the recipient on their choice of academic major. Some of that content might include:
- The recipient's name
- The name of the major itself
- A blurb about the department
- A signature from their new advisor with contact information
Their name and their major are one word each, and can be handled by merge fields. However, the HTML formatted content, like the blurb and the signature, are better suited for content blocks.
Setup
Here's an example of a content block for a Biology major. Notice that we can include conditional content inside the content block, like merge fields, or even nested content blocks.
In this example, because two biology majors might have different advisors, we conditionally display the recipient's advisor using a merge field and a content block. The advisor's name is represented by the merge field {{faculty_advisor}}
, and their signature, which includes an image of their headshot, is represented by the nested content block {{faculty_username| block: "advisor_headshot"}}
.
In a mailing
Rounding out this example, you could then create content blocks for each remaining major, all represented by the key declared_major, and for each remaining advisor, similarly represented by the key advisor_headshot. The configuration of a set of content block codes for the keys representing academic majors and advisors might look like the following:
Now that we've seen what content blocks can do, let's get our hands dirty and make one.
Creating Content Blocks
Two steps to creating content blocks:
- Configuring the content block key, which determines the type of data it stores. Like prompts and translation codes, content blocks are associated with and grouped together by keys.
- Creating content block content. A single key can include multiple units of content, called codes.
Step one: Configuring the content block key
To create a new content block or set of content blocks, first configure a new content block key:
- From the main navigation, select Deliver.
- On the right, select Content Blocks.
- Click New Key. A pop-up appears.
- Configure the following settings:
- Key - Enter a computer-friendly name, such as "major," to represent this content block key. Do not include any spaces or special characters.
- Folder - Place the content block key in an existing folder, or create a new one by selecting Other and entering a name (in this case, "Majors").
-
Type - Select the type of value that this group of content blocks should present in a mailing:
- String (Discrete Values): The value of the content block should exactly match a string.
- Integer (Inclusive Range of Values): The value of the content block should fall within a specified range of integers.
- Real Number (Inclusive Range of Values): The value of the content block should fall within a specified range of real numbers.
- Date (Inclusive Range of Values): The value of the content block should fall within a range of dates.
- DateTime (Inclusive Range of Values): The value of the content blocks should fall within a specified range of dates and times.
- Default Snippet - Enter content here that should be displayed in cases where the recipient's data does not match any of the content block values.
- Click Save.
Once a key has been created, click Edit to change these settings.
Step two: Creating the codes
Multiple codes can be configured for a single content block key. When configuring each code, it is important to remember that the value of each content block code should correspond with the type (String, Integer, Real Number, Date, or DateTime) selected on the previous screen. To create the content block content:
- From the main navigation, select Deliver.
- On the right, select Content Blocks.
- Select the content block key that you created earlier.
- Click New Code. A pop-up appears
- Configure the following settings:
- Status: Active
- Value: For String content blocks, enter a string for the value (for example, "Biology"). These values should exactly match the export from the query that will reference the content blocks. For Integer, Real Number, Date, and DateTime content blocks, enter a minimum and maximum value.
- Content Block - Use the WYSIWYG editor to create the content for the this content block value.
- Click Save.
- Repeat steps four and five to create additional content blocks that use this key.
Tip
For content blocks where the values are discrete rather than a range, enter the same value for both the minimum and maximum values.
No special characters in content block values
Content block values should not contain special characters such as ampersands (&), apostrophes ('), quotation marks (") or slashes (/). If content blocks need to match on values that contain special characters, use a custom SQL format mask to replace these characters with their string equivalent.
This format mask should be added to whatever export is being referenced in the content block merge field. For example, if you apply a content block to their major field, the custom SQL format mask should be added to the "Major" export on the associated query.
To add a custom SQL format mask to an export:
- Navigate to the query supplying the exports. In this example, this is the recipient list of the mailing, so click Deliver, select your mailing, and click Edit Recipient Lists, and select the mailing.
- Click Edit Query.
- Hover over the export you need to mask and click Edit. A pop-up appears.
- From the Format Type list, select Formula / Custom SQL (use @val).
- In the Format Mask field, enter "replace(@val, '[special character to be replaced]', '[value to replace it with]')". See examples below.
- Click Save.
Custom SQL format mask examples:
To replace an ampersand with the word "and":
replace(@val, '&','and')
To remove an apostrophe:
replace(@val, '''','')