This guide explains all of the media gallery settings componenets that are available to be used in your plugin’s settings JSON configuration, giving your app users the ability to find the media they want to add into their email content.

Compatible settings components

Components for media source plugins work slightly differently than other plugin types. Check below to see how to utlize our preset search, filter and sort functionality, powered by groups:
The optional search functionality utilizes a text input component, housed in a media source specific group called search_group - offering a way for creators to filter your images through a text filter.
{
  "type": "group",
  "name": "search_group",
  "settings": [
    {
      "type": "text",
      "name": "search",
      "label": "Search",
      "help": "Search Giphy",
      "required": false
    }
  ]
}
It is good practice to make this as smart as possible - ensuring that you return the elements that make sense with the text inputted by the user. This means matching against the name of the image, but also any other relevant metadata a creator may be filtering by (e.g. you may want to include the name of the Folder within the search logic). Upon keystroke, a new POST request will be made to the request URL specified, with the text inputted, for your app to return a newly sorted version of results.

Filter

The optional filter functionality allows plugins to offer a flat, single-select dropdown the creator can select from to help them find the content they are looking for. This can be predefined through use of the select input component or programmatically generated as the plugin loads, through use of the dynamic select input component.
Regardless of whether your plugin utilizes a select input component or a dynamic select input component, this will also need be housed in a media source specific group, named filter_group. Examples for each can be found below:
{
  "type": "group",
  "name": "filter_group",
  "settings": [
    {
      "type": "select",
      "label": "Rating",
      "name": "rating",
      "options": [
        { "label": "G", "value": "g" },
        { "label": "PG", "value": "pg" },
        { "label": "PG-13", "value": "pg-13" },
        { "label": "R", "value": "r" }
      ],
      "required": false
    }
  ]
}

Sort

The optional sort functionality utilizes a select input component to offer a flat list of sort options the creator can select from, each with a label and value nested in an options array. Once an option is selected, a new POST request will be made to the Request URL specified, with the value selected, for your app to return a newly sorted version of results. This will need to be encased by a media source specific group named sort_group.
{
  "type": "group",
  "name": "sort_group",
  "settings": [
    {
      "type": "select",
      "name": "sort",
      "label": "Sort",
      "options": [
        { "label": "Alphabetical (A-Z)", "value": "alphabetical_asc" },
        { "label": "Alphabetical (Z-A)", "value": "alphabetical_desc" }
      ]
    }
  ]
}