Skip to main content

(New Plugin) Configuration of custom modules library

In this article, you will learn how to set up custom modules library in the Stripo Plugin.

Anna avatar
Written by Anna
Updated yesterday

If you want to offer your users interesting structures with a non-standard layout or provide the opportunity to save particular elements separately from the entire email (such as structures, containers, stripes) for future use and easy drag-and-drop functionality, you can do so with modules.

Similar to the Image gallery, users can see as many folders (tabs) in the Modules tab as you've and configured for your Plugin application.

In this section, you can manage number of folder, folder's names, Storage key ID and grant permissions.

You can specify the Storage Key ID as a static value or a variable (use braces, e.g., ${UserId}).

For example, if you want to restrict access to one user’s modules from another user, you can create the ‘My modules’ folder and specify its path as ${UserId}. When initializing the Plugin, pass the userId value (e.g., 00000) to the metadata parameter. As a result, the Plugin will fetch the modules from the database by the key “00000”.

Please be advised that you can turn off this feature so the Library section won’t display in the editor at all.

More detailed about module's section you can find here.

Synchronized Modules

Synchronized Modules allow for seamless updates across all email templates that utilize a specific module. This feature is particularly useful for tasks such as updating branding or contact details, as changes made to a synchronized module will be applied automatically to all templates where the synchronized module is activated.

How to Activate

To enable the Synchronized Modules feature, initialize the plugin with the following parameter:

"syncModulesEnabled": true

Once enabled, your customers can save their modules and while saving they can activate the synchronized module option.

Usage

When a synchronized module is dropped into the email, a "Sync OFF" symbol will appear on the module. Customers can then choose to:

  • Update: Apply modifications to the module in the library.

  • Restore: Revert the module to its default state.

  • Make Unsynchronized: Convert the module to a standard, unsynchronized module.

If a user lacks permission to modify the module, the "Update module" option will be hidden from the settings panel.

How It Works

  1. When the specified parameter is included during plugin initialization, the editor queries its database for all saved synchronized modules based on the configurations provided (such as those in the metadata parameter).

  2. The editor scans the HTML of the opened template to detect any synchronized modules. If found, it replaces the content with the version saved in the library.

  3. If the plugin was initialized with the syncModulesEnabled parameter, the getTemplateData method returns the HTML, CSS, and arrays of IDs of synchronized modules used in the template.

  4. Once you receive a notification about changes in your email template, you can call the Get HTML and CSS of email template method from your server. Our backend returns the HTML, CSS, and IDs of synchronized modules used in the template.

  5. The plugin owner must store the information about which synchronized module IDs belong to which template in their database. When a synchronized module is updated, the editor fires an module_saved event that the customer’s application must read to start the synchronization of other templates containing that module.

  6. To achieve this, run the “Compiling Email Templates” method ONLY for THOSE templates that include the updated module.

    Please find also the reference here.

    During the request of this method, the system expects to receive 2 Headers: ES-PLUGIN-AUTH (your plugin token) and ES-PLUGIN-UI-DATA (with parameters to identify email (Same as metadata param in UI editor). For example: {"emailId": "id1"}).


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?