(Plugin) Initialization

In this article, you will take a look at the basic plugin initialization parameters to display the editor in your application for customers.

Marina Krivenets avatar
Written by Marina Krivenets
Updated over a week ago

To initialize the Plugin, you should create your own logic for your application.

For example, you can display the templates on your interface and relate them with the initialization process, so when a user clicks on one of them, your application calls the initialization function and passes the HTML and CSS code of the selected template to it from your server.

Or you can choose to simply add a button named "Create a template," and upon a click on it, your application calls the same initialization function but passes the HTML and CSS code of the default empty template to it.

The general point is to start the initialization process and pass the list of needed parameters.

Once you have added the Stripo Plugin assets on your web page, you need to initialize the Plugin.

For Plugin initialization, you have to call the window.Stripo.init function:

window.Stripo.init({[put here your plugin JSON configuration]});

The default initialization script for the Stripo Plugin should go with these items:

window.Stripo.init({

   settingsId: '[put here ID of your settings container]',
   previewId: '[put here ID of your preview container]',
   html: '[put here HTML code of your email]',
   css: '[put here CSS code of your email]',
   apiRequestData: {
      emailId: '[put here ID of email in your external application]'
   },
   getAuthToken: function(callback) {
   }
});
  • settingsId and previewId values are the values that you have previously specified for 2 divs containers to display the Plugin;

  • then you should pass/transmit that HTML and CSS, which will be loaded for your customers when they open the editor. You should have a list of email templates that are stored on your end. Please follow this documentation to get more about templates requirements;

  • in the apiRequestData section, you have to specify the mandatory emailId parameter (for these HTML and CSS), which we will serve as Unique ID and specify all other parameters that will be sent to the server with each request. They may be used to identify a path to the Image storage documents and modules. You can use any parameter you want, just be sure that it passes to the apiRequestData parameter during Plugin initialization;

  • the last important part of the Plugin initialization is the getAuthToken function which is required for your authentication. Plugin calls function (this parameter value) each time when a token is expired to get a new one. You have to implement this method on your side, which will be an automatic process. Please refer to the Plugin authentication article for more details and a manual.

Additionally, you can add other parameters to the initialization script. It allows you to get more opportunities for your users according to their category.

As a result, you can independently determine all these parameters following the list of available configuration parameters during the Plugin initialization.


If the editor is closed by the user in your web application, we recommend calling the following function to stop all processes and improve the performance of your application:

window.StripoApi.stop();



Thank you for taking the time to read our articles. We hope you will find this information helpful.

If you have any additional questions, please email us at support@stripo.email.

We would be glad to talk with you.


Did this answer your question?