Skip to main content

Custom Blocks

Create reusable email and landing page components using simple form inputs instead of HTML.

What Are Custom Blocks?

Custom Blocks are reusable content sections for emails and landing pages. You define the layout once. You reuse it across assets.

Instead of editing HTML, you fill in fields like text, links, or dropdowns.

Key Benefits

  • Reuse consistent layouts across campaigns

  • Prevent HTML editing errors

  • Speed up content creation

  • Customize content using simple inputs

Note: This feature is currently in Alpha testing. For any questions about this feature or to participate in the Alpha program, contact Grace Lee at grace.lee@knak.com.


Create A Custom Block

Create a Custom Block for your marketing team to reuse.

Open Custom Blocks

  1. Go to Admin.

  2. Select Custom Blocks from the left navigation.

  3. Click Create Custom Block.

    Custom Blocks page in the Admin section showing existing Custom Blocks and the Create Custom Block button.

Create the Default Version

The default version serves as the fallback version of the Custom Block. It is used whenever an integration-specific variant is not available.

  1. Enter the following information:

    • Name

    • Description

    • Custom HTML

    Create Custom Block form with fields for name, description, and custom HTML.
  2. Click Add Variable.

    Add Variable dialog showing fields for variable name, label, type, and default value.
  3. Enter the following information:

    • Name

    • Label

    • Type

    • Default Value

    Example variable configured for the Select Recommendation Source Custom Block.
  4. Click Create to save the variable.

    Example variable configured for the Select Recommendation Source Custom Block.
  5. Repeat these steps for any additional variables.

Configure Integration-Specific Variants (Optional)

You can create integration-specific versions of a Custom Block when additional code or syntax is required for a specific marketing automation platform.

  1. Open the integration-specific variant you want to configure.

    Integration drop down menu when configuring custom blocks.
  2. Update the HTML for the selected integration.

  3. Save your changes.

Integration-specific variants use the same variables as the default version.

Example Use Cases:

  • The default HTML might use standard inline styles

  • A Marketo variant might include Marketo-specific tokens or tracking scripts

  • A HubSpot variant might use HubSpot module syntax

Save the Custom Block

Click Create Custom Block.

The Custom Block is now available to use in emails, landing pages, modules, and themes.


Add A Custom Block To An Asset

Add a Custom Block directly from the builder.

Steps

  1. Drag a Custom Block element into your email or landing page

    Custom Block element being dragged from the content panel onto the canvas.
  2. View the selection modal

  3. Search or browse available blocks

  4. Select a custom block and click Select Block.

    Custom Block selection modal showing available Custom Blocks to add to an asset.
  5. After selection, the block loads on the canvas with a preview.


Edit Custom Block Content In An Asset

You edit content in Custom Blocks by using fields. You do not edit HTML.

Open Block Settings

  1. Click the Custom Block on the canvas

  2. Open the right-side panel

Update Block Variables

Each field maps to a variable created by your admin.

  • Text input → Single-line text

  • Text Block → Multi-line text

  • Dropdown → Select from options

Custom Block settings panel displaying editable variable fields.

Preview Changes In Real Time

See updates instantly as you edit.

How It Works

  • Edit a field

  • Wait a few seconds

  • View the updated preview on the canvas

The system refreshes the preview automatically.

Understand Preview Behavior

  • Preview uses default HTML only

  • Integration-specific versions are not shown in preview

  • Final output may differ after sync


HTML Sanitization

Preview HTML is sanitized server-side using HTMLPurifier. This helps ensure safe rendering while preserving supported formatting.

Allowed Attributes

  • The following HTML attributes are supported:

    • style, class, id, lang, dir, align, valign, width, height, title, bgcolor

  • Table and cell-specific attributes

  • Image attributes such as src and alt

  • Link attributes such as href and target

Allowed URI Schemes

The following URI schemes are permitted:

  • http, https, mailto, tel, sms

CSS Support

Trusted mode is enabled for CSS. This preserves legitimate inline styles during sanitization.


How Content Is Stored

Your inputs are saved inside the asset. They are not stored separately.

What This Means

  • Values are stored as structured data

  • Data stays tied to the block in your email

  • Each block instance can have different values


Need more help? Contact support via live chat using the chat bubble in the bottom right corner or email support@knak.com.

Did this answer your question?