SubsKeepr
SubsKeepr
NNovu
Created by SubsKeepr on 10/27/2024 in #💬│support
Failed to preview Step with id: `send-email`
I am trying to use a react-email template and I cannot get it to preview in the local studio as I keep getting that error. Other ways seem to work like inline html with vars.
// app/novu/workflows/trial-ending.js
import { workflow } from "@novu/framework";
import { renderTrialEmail } from "../emails/trial-ending";

export const trialEndingWorkflow = workflow(
"trial-ending",
async ({ step, payload }) => {
const isLastDay = payload.daysLeft === 0;
const daysMessage = isLastDay
? "ends today"
: `ends in ${payload.daysLeft} days`;

// Push notification if enabled
await step.push("push", async () => ({
subject: "Trial Ending Soon",
body: `${payload.subscriptionName} trial ${daysMessage}`,
}));

// Email notification with HTML template
await step.email("send-email", async (inputs) => ({
subject: `Your ${payload.subscriptionName} Trial is Ending Soon`,
body: renderTrialEmail({ ...payload, ...inputs }),
}));
}
);
// app/novu/workflows/trial-ending.js
import { workflow } from "@novu/framework";
import { renderTrialEmail } from "../emails/trial-ending";

export const trialEndingWorkflow = workflow(
"trial-ending",
async ({ step, payload }) => {
const isLastDay = payload.daysLeft === 0;
const daysMessage = isLastDay
? "ends today"
: `ends in ${payload.daysLeft} days`;

// Push notification if enabled
await step.push("push", async () => ({
subject: "Trial Ending Soon",
body: `${payload.subscriptionName} trial ${daysMessage}`,
}));

// Email notification with HTML template
await step.email("send-email", async (inputs) => ({
subject: `Your ${payload.subscriptionName} Trial is Ending Soon`,
body: renderTrialEmail({ ...payload, ...inputs }),
}));
}
);
8 replies