Leverage MJML package to send email notifications
my-novu-app
but you can choose your own.
Give your app a name
Choose if you want to install React email or not
Let all the dependencies get installed
npm run dev
command, and your app will be served on localhost:4000
http://localhost:4000
and you can make changes to your app as you see fit. Let’s now move to the meaty stuff - using Novu Framework in a NextJS app and the magic of Dev Studio.
npx novu-labs@latest echo
. The Dev Studio will be started by default on port 2022
, and accessible via: http://localhost:2022
Echo Dev Studio runs on 'localhost:2022' by default. Here I’m already using port 2022 so it is starting on a different port but we recommend ensuring that port 2022 is free
Echo Dev Studio on the first run
Echo endpoint
at the bottom. Novu Echo requires
a single HTTP endpoint (/api/echo
or similar) to be exposed by your application.
This endpoint is used to receive events from our Worker Engine. We have more on Novu
endpoint in our docs.
http://localhost:4000/api/echo
Enter Echo endpoint URL
connected
highlight at the top right corner.
require
statement when
importing MJML in our files, such as when defining the template.Echo Dev Studio now picks up the workflow we just created
Sync to Cloud
button.
Payload | Step Inputs |
---|---|
is used for dynamic content that changes from one notification to another based on events occurring in your system. | are used for static elements or predefined options that non-technical team members can modify without altering the codebase. |
is controlled by developers and passed dynamically through the novu.trigger method. | are defined by developers but aremeant to be utilized and modified by non-technical peers. |
Payload examples include User ID, Post ID, Comment, Order ID, 2FA token, etc., which are likely to change with each notification. | Step Inputs examples include the text of a button, whether a section should be shown, static text content, etc., which are generally static but configurable elements. |
Payload modifications are made in the code by developers at the time of triggering a notification. | Step Inputs can be modified directly in the UI, offering a no-code solution for non-technical team members to make changes. |
Payload data is passed during the novu.trigger method and is part of the dynamic data handling process within notification workflows. | Step Inputs are predefined in the workflow configuration and can be adjusted through the Echo Dev Studio, affecting how notifications are rendered without changing the workflow logic. |
npm run dev
script in the project launches both the Bridge application and the tunnel solution. The tunnel URL shows up in the console output.
You can also use a tool like ngrok
:
ngrok has done its magic
/api/novu
or similar) you expose in your application for
handling Novu Framework requests is what you’d consider the Bridge URL
.
This URL would be the endpoint within your application’s domain where Novu’s Worker Engine sends requests to fetch notification content or subscriber details dynamically. In our case, it is this: https://faec-2409-40f2-3c-3b57-400e-a7f7-1fc0-1e5.ngrok-free.app/api/echo
So, we’ll enter this Bridge URL:
Enter the Echo URL in the Dev Studio
Echo Dev Studio will create a diff for you
Test your workflow will take you to Novu Cloud
You'll see the workflow created using Echo with the blue lightning bolt icon
Enter the respective data and test your workflow
Workflow test email in my inbox
submit
event fires:
Here’s a simple replication of the stipulated scenario: