Setting up your content block plugins
Example content block insertion menu
Example sidebar configuration
name
is the user-facing name for your block. In the content block insertion menu example above, “Post”, and “Product” are names
. It will appear in the editor’s element menu, and also in the breadcrumbs at the top of the sidebar when your block is selected. Your name
should be short, ideally one or two words.
description
is a short phrase describing your block. It will appear underneath the name in the element menu. In the example above, “Add a link to a post” and “Add a link to a product”.
sort order
determines their placement. In the example above, “Post” has a sort order
of 0
, while “Product” has a sort order
of 1
.
icon
is an image for the node to be displayed alongside the name
and the description
. A monochrome SVG is recommended. PNG, GIF, JPEG extensions are also supported. The recommended size is 150x120px.
Request URL
is the URL of an endpoint on your server that returns an HTML string. This endpoint’s job is to generate the HTML for your element to be rendered in the email editor.
You’ll generate this HTML based on the settings you’ve defined for your block (outlined in the plugin settings page). Once a user completes all required settings, we’ll make a POST request to your Request URL
. The request will contain a settings
object with the user’s selected values for each of your settings:
Request URL
should respond to this request with a JSON object containing an html
key:
errors
array of strings. You may add as many errors to this array as you’d like:
type
determines the UI rendered (such as a text input or a color picker); all available options are listed under the plugin settings page.
The name
for each setting is used as the key in your HTML request: