List AddOn
Overview
The List AddOn type allows you to insert ordered (numbered) or unordered (bulleted) lists with custom formatting. This is perfect for feature lists, step-by-step instructions, or any content that benefits from a list structure.
Prerequisites
Before implementing a List AddOn in your code, you must first create the addon in the Beefree SDK Developer Console. Take the following steps to complete this:
Log into the Developer Console and navigate to your application.
Create a new Custom AddOn and select List as the type.
Configure the addon with a unique handle (e.g.,
my-list-addon).Choose your implementation method (Content Dialog or External iframe).
Save the addon configuration.
Important: The handle you create in the Developer Console must match the addon ID you reference in your code's beeConfig. This handle serves as the unique identifier that connects your code implementation to the addon configuration in the console.
Content Object Schema
This section discusses the List AddOn's object schema. Understanding this schema is a core part of successfully implementing a Custom List AddOn type.
Visit the complete Unified Schema in GitHub to see a comprehensive reference on how to structure data for all Custom Addons.
Required Structure
The List AddOn schema requires two critical properties: tag (which specifies 'ul' for unordered/bulleted lists or 'ol' for ordered/numbered lists) and html (which contains the actual list markup). Optional styling properties like color, size, and text formatting allow you to pre-style lists for brand consistency, while users can further customize after insertion.
Unordered List (Bullets)
This example demonstrates an unordered list with bullet points, perfect for presenting features, benefits, or options where order doesn't matter. The tag: 'ul' specifies bullet formatting, while the html property contains standard list markup that will render with bullet points in the email.
Ordered List (Numbers)
This example shows an ordered list with sequential numbering, ideal for step-by-step instructions, procedures, or any content where order matters. The tag: 'ol' tells Beefree to render the list with numbers, and the bold: true property emphasizes the text for greater visual impact in the email.
Styled List Example
This comprehensive example demonstrates all available styling options for lists. By pre-configuring properties like font size, text formatting, colors, and alignment, you can ensure brand consistency while still allowing users to edit the list content after insertion. This pattern is particularly useful for maintaining visual standards across email campaigns.
Content Dialog Implementation
This section covers how to implement a Custom List AddOn using the Content Dialog method. It includes code snippets for three different scenarios:
Scenario 1: End user input not required
Scenario 2: Dynamic list generation
Scenario 3: User-defined list
End user input not required
The Content Dialog method allows programmatic list insertion through a JavaScript handler. When users drag your list addon onto the stage, this handler is immediately invoked and resolves with a predefined list. This pattern works perfectly for static list content that doesn't require user configuration, providing instant insertion of consistently formatted lists.
Dynamic List Generation
This pattern demonstrates programmatic list generation from an array of data, making it easy to create lists from dynamic sources like APIs, databases, or configuration files. By mapping through your data array, you can transform structured information into properly formatted list HTML, enabling dynamic content insertion while maintaining consistent markup structure.
User-Defined List
This advanced pattern shows how to let users create custom lists through an interface before insertion. By opening a dialog where users can add, edit, or remove list items and choose between ordered or unordered formatting, you provide maximum flexibility while maintaining proper list structure. The handler filters out empty items and validates input before resolving, ensuring clean list insertion.
Iframe Implementation
This section discusses how to implement the Custom List AddOn using the Iframe implementation method. It includes the core concepts you need to understand to successfully implement List AddOns using an Iframe workflow.
Conceptual Flow
The Iframe method allows you to create a fully custom interface for list creation using any web technology. Your iframe application communicates with Beefree through postMessage events, following a specific protocol. This approach is ideal when you need a rich UI for list management, including features like drag-and-drop reordering, formatting options, or template selection before inserting the list into the email template.
Required postMessage Communication
Implement the standard postMessage protocol to integrate your iframe with Beefree. First, notify Beefree when your iframe is loaded and specify the dialog dimensions. Listen for the "init" message to receive editor context. When the user finishes creating their list, send "onSave" with your list object. If the user cancels, send "onCancel" to close the dialog without inserting content.
1. Send "loaded" when your iframe is ready:
2. Listen for "init" and "load" messages from Beefree:
3. Send "onSave" with list data:
4. Send "onCancel" if user cancels:
Simple Iframe Example
This complete HTML example provides a functional list creation interface. It demonstrates the full postMessage protocol and includes a dynamic item input system where users can add multiple list items and choose between ordered or unordered formatting. The interface builds proper list HTML and sends it to Beefree. You can expand this basic example with rich text editing, item reordering, or pre-built list templates.
Last updated
Was this helpful?

