Blog

[Labs] Medusa marketing plugin for MedusaJS

06/07/2024

[Labs] Medusa marketing plugin for MedusaJS

Today on our blog we would like to present a new plugin, which we believe can be very useful for anyone using MedusaJS e-commerce ecosystem. Here is a story, of what you can achieve with this plugin.

 

Background

 

We have noticed that the basic functionality which is for instance sending welcome messages to customers is not covered out-of-the-box in MedusaJS. There are plugins, like the SMTP plugin or SendGrid plugin, but all of them are very low level plugins that require some more custom configuration to handle customer’s actions.

We wanted to give people a framework, which provides more abstraction over different actions.

 

Basics

Medusa marketing comes with Admin UI and backend implementation. However, to have it working properly we need to first configure a plugin in the usual way – by editing `medusa-config.js`. We do not want to duplicate what is in Github, so we just providing a link to the instruction.

 

Use cases

 

As we mentioned, the first thing that comes to mind when thinking about marketing is the welcome messages sent to customers when they are creating an account.

Medusa marketing provides a nice interface for that. Below you can see how you can configure your welcome messages:

We support two kinds of templates now – `html` and `pug`. The examples are located here,┬áso you can easily follow them to create your own.

In the above picture, you see a template related to the welcome message, which is filled by custom properties, that come from the action. Every kind of action provides different properties that can be used in templates. For example, welcome messages provide the following properties:

 

You can use them in your templates to customize messages to your customers.

On the other hand, back-in-stock action provides the following properties:

Thanks to that, you can create a custom message, which will be sent to the customer:

You may notice that we are using titles, thumbnails, etc. to create a message.

 

Finally, on the main page, you can see a summary of configurations and sent messages:

Every action can be disabled or enabled (on the screen you may notice that both of them are enabled).

For some actions (e.g. back in stock) subscriptions from customers are required, so we are also presenting them on the summary page. Of course, we are providing a custom API for your storefront which lets you implement your subscription mechanism for an action. APIs definitions can be found here.

 

Summary

 

Medusa marketing is an abstraction over the common actions, which can be used for sending emails to customers. It greatly improves customers’ perception, because your shop can be seen as more professional. What is more, back in stock mechanism also can increase your sales when people are waiting for your products’ availability.

Medusa marketing has been released recently on NPM with version 0.1.2. This is just a start, but the framework itself is very powerful. There are plenty of actions, that can be implemented to increase your connection with customers like sending the status of orders, sending information about available products, sending information about products which are fulfilled, order’s cancellation, and a lot more.

 

We hope you will find this plugin useful. If you need any support – please contact labs@rsoftcon.com.