Content blocks plugin settings
Sidebar settings components
This guide explains all of the sidebar settings componenets that are available to be used in your plugin’s settings JSON configuration, giving your app users the ability to select and customize the HTML content they want to add into their email content.
Settings components
Color picker
Use the type: color
setting config for a color picker.
Font picker
Use the type: fontFamily
setting config for a font family and font weight picker. Kit will automatically supply a list of email-friendly font families and their fallbacks.
When requesting HTML, Kit will pass the user’s values for fontFamily
fields as an object with a fontFamily
and a fontWeight
.
Date picker
Use the type: date
setting config for a date picker.
All dates are returned in UTC, ISO8601 format such as: “2024-10-03T07:00:00.000Z”
Search input
Use the type: search
setting config for a search input.
When the plugin loads, Kit will make a request to your provided request_url
with an empty string search
param. This allows you to autopopulate the search dropdown with default results.
When the creator types into the search input, Kit will make a debounced request to your provided request_url
to retrieve further filtered results.
If a creator leaves their email in a draft state and edits again in the future, we’ll make a request to your provided request_url
with the value
of the option they had previously selected. This allows us to fill the dropdown with your user-friendly label.
The optional dependencies
configuration allows you to wait to display a search input until the creator has entered values for all of the dependency inputs.
Once all the dependencies have a value, your dependent search input will be displayed. And we will include the dependencies as parameters to your provided request_url
.
You should return an array of objects, each with a label-value pair.
The label
will be visible to users; it is used as the text for the result. The value
is not visible to users, but will be sent when requesting HTML for your block.
If something goes wrong, we also accept an errors
array.
If you configure multiselect: true
, then the creator will be able to select multiple options. This will be sent as an array of strings to your request_url
.
Select input
Use the type: select
setting config for a select input, commonly called a “dropdown menu” with a predefined list of options. The chosen value
is not visible to users, but will be sent when requesting HTML for your block.
Text input
Use the type: text
setting config for a single-line text input useful for entering short snippets of text.
Global configuration options
Required settings
You can optionally add required: true
to a setting. We won’t request HTML from your server until all required settings are complete.
Help text
You can optionally add help text for creators when using your plugin. You can add help: "some help text"
to any setting and we’ll render a tooltip on your input label with your help text.
Refreshing data
After a user has configured all required settings, we will perform a request to your server for the block’s HTML. If the user wants to refresh the data, they can either:
- Click the refresh button that appears when hovering over the element (pictured below), or
- Change one of your plugin’s settings in the sidebar, which will automatically kick off another request for new HTML.