Search for Resources and Solutions

set_libs - adds libs in the Midrub Emails Composer

set_libs is an important Midrub Emails Composer's method which i've invented to add the features in the Midrub Emails Composer. The libs can be used in the template's settings and in template customizations. 

The libs in the Midrub Emails Composer are the text editor, slider, color picker, different kind of inputs, file upload, etc. You can develop your libs and use them in the Midrub Emails Composer.

The parameters in a library are:

  • name - is the library's name. Should be a string.
  • slug - is the libray's slug. Should be an original string/word.
  • model - tells to the method which calls the library what kind of data should provide.
  • run - contains the function which will return the html. Please remember, the run's parameter is the data passed by the called method.

The model parameters are:

  • slug - is a string with the field used in the html(for example data-{slug}).
  • default - has the default data which is provided to what generates the library.
  • type - has the default value type. Is a string.
  • required - has true or false. And it says if the parameter is required or no.

In the video below you can see a simple example with the method set_libs:


Was this article helpful?