Creating Content Blocks (formerly Mailing Snippets)
  • 04 Apr 2024
  • 4 minute read
  • Dark
    Light
  • PDF

Creating Content Blocks (formerly Mailing Snippets)

  • Dark
    Light
  • PDF

Article Summary

🔑 Required Permission:

Deliver Content Blocks

📝 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.

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.

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, you can use translation codes and/or Liquid markup.

Example: 🎓 Student Success

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:

Example_Content_Block_Code_-_Advisor_Signature.png

 

In a mailing

So, here's what you see setting up the mailing in Deliver:

Mailing_with_major_content_block.png

And here's what the recipient sees 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

Creating Content Blocks

Configure the Content Block Key

To create a new content block or set of content blocks, first configure a new content block key:

  1. Click Deliver in the top navigation bar and select Content Blocks (snippets) on the right.

  2. Click New Key. Content blocks are associated with a key, much like Prompts and Translation Codes, that groups the content blocks together.

  3. Enter the following configurations in the popup window:

    • Key - Give this set of Content Blocks a computer-friendly name, such as "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.

      • Select String (Discrete Values) if the value of the content block should exactly match a string.

      • Select Integer (Inclusive Range of Values) if the value of the content block should fall within a specified range of integers.

      • Select Real Number (Inclusive Range of Values) if the value of the content block should fall within a specified range of real numbers.

      • Select Date (Inclusive Range of Values) if the value of the content block should fall within a range of dates.

      • Select DateTime (Inclusive Range of Values) if the value of the content blocks should fall within a specified range of dates and times.

    • Default Snippet - Include a default snippet to have this content displayed in cases where the data does not match any of the content block values.

  4. Click Save. Once a key has been created, click the Edit button at any time to edit these settings.

For example, a use case is that Slate University would like to merge in something relevant to the recipient's interest in an academic major. The configuration of a set of content blocks for interest might look like the following:

Example_Content_Blocks.png

Configure the Content Block Content

Similar to Translation Codes, multiple codes can be configured per 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 that was selected on the previous screen. To create the content block content:

  1. Click New Code.

  2. Enter the following configurations in the popup window:

    • Status - Leave this as Active.

    • Value - For String content blocks, enter a string for the value (e.g., 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.

  3. Click Save.

  4. Repeat steps 1-3 to create additional content blocks that use this key.

Tip

For content blocks where the values are discrete rather than a range, simply enter the same value for both the Minimum Value and the Maximum Value.

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

Biology_Content_Block_Example.png

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 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 the word "and":

replace(@val, '&','and')

To remove an apostrophe:

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


Was this article helpful?