React E-mail
API Reference
Subscribers
- GETGet subscribers
- POSTCreate subscriber
- POSTBulk create subscribers
- GETGet subscriber
- PUTUpdate subscriber
- DELDelete subscriber
- PUTUpdate subscriber credentials
- DELDelete subscriber credentials by providerId
- PATCHUpdate subscriber online status
- GETGet subscriber preferences
- GETGet subscriber global preferences
- PATCHUpdate subscriber preference
- PATCHUpdate subscriber global preferences
- GETGet in-app notification feed for a particular subscriber
- GETGet the unseen in-app notifications count for subscribers feed
- POSTMark a subscriber feed message as seen
- POSTMarks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
- POSTMark message action as seen
- GETHandle providers oauth redirect
- GETHandle chat oauth
Topics
Notification
Workflows
Workflow Overrides
Workflow groups
Integrations
Layouts
Execution Details
Organizations
React E-mail
Integrating Novu Framework with React.Email for your Next.js application can be done in three steps. If you don’t have an app, you can create one with the create-novu-app
command.
1
Install React.Email components
Install the required React.Email components.
npm i @react-email/components react-email
2
Write your email
Create a new sample-email.tsx
file for your email template.
import * as React from "react";
import { Button, Html } from "@react-email/components";
function Email(props) {
return (
<Html>
<Button
href="https://example.com"
style={{ background: "#000", color: "#fff", padding: "12px 20px" }}
>
Click me
</Button>
</Html>
);
}
export function renderEmail(inputs) {
return render(<Email {...inputs} />);
}
3
Write your workflow
Define your Workflow using the above template
import { renderEmail } from './sample-email.tsx';
import { workflow } from '@novu/framework';
workflow('new-signup', async ({ step, payload }) => {
await step.email('send-email', async (inputs) => {
return {
subject: `Welcome to React E-mail`,
body: renderEmail(inputs),
}
});
});
Was this page helpful?