Content Blocks

Prev Next

Content blocks let you insert large blocks of conditional HTML content into many areas in Slate, including mailings and portals.

Content blocks are handy for information that is frequently reused, like staff email signatures. They can also be useful for displaying conditional HTML content to specific audiences. Slate uses a supplied value to select content from the codes under a content block key. You can also configure a default snippet for values that do not match a code.

A content block for academic interest resolves to a message about the biology department when sent to a recipient with Biology as their academic interest.

Some other examples might include:

  • Showing off improvements to your STEM facilities to only those prospects, current students, or alumni who have expressed an interest in STEM.

  • Serving information specific to a mailing recipient’s stated academic interest.

💡 Formerly known as: mailing snippets

Content blocks replace what were once known as mailing snippets. You may see content blocks referred to as mailing snippets in Slate documentation and in the Community. The terms are equivalent. Inbox Snippets are distinct from content blocks.

Creating a new content block

To create a new content block or set of content blocks, you must configure a new content block key.

🔑 Required permission: Deliver Content Blocks

Content block keys

Content blocks use keys and codes, analogous to a prompt key and its values. A content block key is a named, typed value that groups codes together. For example, in a mailing, you might want to merge in text about the recipient’s interest in an academic major. To do this, you can create a content block key with a type of String called interest and create codes under it for Biology, Chemistry, Engineering, and Physics. In each of these codes, you’d configure content specific to the major.

Example_Content_Blocks.png

Creating a content block key

To create a new content block key:

  1. Go to Deliver → Content Blocks.

  2. Select New Key.

  3. Configure the following settings:

    • Key: Give this set of Content Blocks a computer-friendly name, like interest. It should not include any spaces or special characters.

    • Folder: Place the Content Block in an existing folder, or create a new one by selecting Other and entering a name (in this case, Academic Interests).

    • Type: Select the type of value that these content blocks should match in the mailing:

      • String (Discrete Values): Match a supplied string to the configured code value. Matching is case-insensitive. Slate removes leading and trailing whitespace from the supplied value before matching.

      • Integer (Inclusive Range of Values): You want the value of the content block to fall within a specified range of integers.

      • Real Number (Inclusive Range of Values): You want the value of the content block to fall within a specified range of real numbers.

      • Date (Inclusive Range of Values): You want the value of the content block to fall within a range of dates.

      • DateTime (Inclusive Range of Values): You want the value of the content blocks to fall within a specified range of dates and times.

    • Default Snippet (optional): Include a default block to have this content displayed in cases where the data does not match any of the content block values. If no default block is specified, no content appears.

  4. Select Save.

Select Edit to change these settings after saving.

Configuring content with codes

You can create multiple codes for each content block key. Codes are the technical name for each individual snippet of HTML content that you want to deliver. The value of each content block code must correspond with the type that was selected on the previous screen (ex. string, real, or integer).

Creating a new code

To create the content block code:

  1. Select New Code.

  2. Enter the following configurations in the popup window:

    • Status: Active

    • Value: For String content blocks, enter a string for the value (for example, Biology). These values must match the value supplied to the content block. String matching is case-insensitive. For Integer, Real Number, Date, and DateTime content blocks, enter a minimum and maximum value.

    • Snippet: Use the WYSIWYG editor to create the content for the this content block value.

  3. Select Save.

Repeat to create additional content blocks that use this key. For content blocks where the numeric values are discrete rather than a range, the Minimum Value and the Maximum Value can be the same.

Continuing with the Slate University use case, one content block code using the key of interest might look like:

Biology_Content_Block_Example.png

✨ Prompting Slate AI

Let Slate AI help you build out your content blocks:

💬 Create a footer content block with our contact information and social icons.

💬 Can you help me design a branded header as a content block?

💬 Help me build a content block that displays a personalized greeting using the student’s first name at the top of our inquiry follow-up emails.

Content block values with special characters

Content block values should not contain special characters such as

  • ampersands &

  • apostrophes '

  • quotation marks "

  • slashes /

If content blocks need to match on values that contain special values, 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 replace an ampersand with and:

    replace(@val, '&','and')
  • To remove an apostrophe:

    replace(@val, '''','')

Rendering content blocks

Use the Liquid block filter in an area of Slate that supports content blocks. The filter receives a value and a content block key. Slate finds an active block under that key that matches the value, then inserts its HTML content.

For example, {{academic_interests | block: "interest"}} uses the value of academic_interests to select a code under interest. That value can come from a prompt-backed field or another source.

🔔 The CC field, recipient line, and subject line of a mailing should never be populated with a content block. Use a translation code or liquid markup instead.

To insert a content block as a merge field:

  1. In the WYSIWYG editor, place the cursor where the content block content should appear.

  2. Select Merge Field Merge_Field_Button.png in the top row of the WYSIWYG editor.

  3. From the list, select Other.

  4. Enter the following text:

    NAME OF EXPORT | block: "KEY OF CONTENT BLOCK"

    where NAME OF EXPORT is the name of the export in the recipient list query, and KEY OF CONTENT BLOCK is the key, inside quotes, of the content block that contains the codes to merge into your text.

  5. Select OK.

Using the interest content block key example with an export labeled academic_interests, the merge field will appear as:

In the WYSIWYG editor, the content block appears as a merge field literal, not the content they’d render to the recipient:

When the content is shown to the intended recipient, however, it will display the content from the specified content block key and code. In Deliver, we can use the Preview Message option to preview this from a prospective recipient’s perspective. For instance, this sample record has an academic major interest of Biology, so the content block code with the value of Biology displays:

A sample record with the academic major interest of Physics will display the content block code with the value “Physics”:

💡 Tip

Including a default content block with the content block key ensures that every recipient has content merged in from the content block. If no default content block is included, records without data matching one of the content block values will have a blank line where the content block would otherwise appear.

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.

Example_Content_Block_Code_-_Biology.png

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"}}.

The content block for advisor headshots could then be constructed as follows:

In a mailing

This is what you will see as you set up the mailing in Deliver:

Mailing_with_major_content_block.png

This is what the recipient will see in their inbox:

Test_mailing.png

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:

Example_Content_Block_Key___Codes_-_Academic_Majors___Advisor_Headshots.png


Dynamic content blocks

Content blocks can incorporate liquid markup and translation codes, meaning these tools can all be used together.

📖 Dynamic content blocks

AI content blocks

You can create content blocks that generate content based on a prompt and included context.

📖 AI content blocks

Still looking for what you need?