BrunoLM
BrunoLM
NNovu
Created by BrunoLM on 10/7/2024 in #💬│support
How to notify a topic passing an array of subscribers to exclude?
I have a subscription topic TOPIC-A I want to notify TOPIC-A where the users A, B, C, D, E are subscribed to, but I want to exclude users D and E from this notification. Is it possible?
3 replies
NNovu
Created by BrunoLM on 6/4/2024 in #💬│support
Vercel errors when I open the Preview in Novu using Novu Echo
No description
7 replies
NNovu
Created by BrunoLM on 5/23/2024 in #💬│support
Is it possible to setup a schedule with echo?
No description
6 replies
NNovu
Created by BrunoLM on 5/22/2024 in #💬│support
How to send a weekly email with notifications using echo?
The following seems to only show the last notification and not all of the digested. How can I display all of them in the email?
import { Echo } from "@novu/echo";
import { Body, Container, Head, Html, Tailwind, render } from "@react-email/components";

import { env } from "@/env";

export const echo = new Echo({
apiKey: env.NOVU_API_KEY,
devModeBypassAuthentication: env.NODE_ENV === "development",
});

function ReactEmail(props: unknown) {
return (
<Html>
<Head />
<Tailwind>
<Body className="bg-white my-auto mx-auto font-sans px-2">
<Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] max-w-[465px]">
<pre>{JSON.stringify(props, null, 2)}</pre>
</Container>
</Body>
</Tailwind>
</Html>
);
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function renderEmail(input: any, payload: any) {
return render(<ReactEmail {...input} {...payload} />);
}


void echo.workflow(
"weekly-email",
async ({ step, payload }) => {
await step.digest("weekly", async () => {
return {
amount: 2,
unit: "minutes",
};
});

await step.email("email", async (inputs) => {
return {
subject: "New updates",
body: renderEmail(inputs, payload),
};
});
},
{
payloadSchema: {
additionalProperties: true,
},
},
);
import { Echo } from "@novu/echo";
import { Body, Container, Head, Html, Tailwind, render } from "@react-email/components";

import { env } from "@/env";

export const echo = new Echo({
apiKey: env.NOVU_API_KEY,
devModeBypassAuthentication: env.NODE_ENV === "development",
});

function ReactEmail(props: unknown) {
return (
<Html>
<Head />
<Tailwind>
<Body className="bg-white my-auto mx-auto font-sans px-2">
<Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] max-w-[465px]">
<pre>{JSON.stringify(props, null, 2)}</pre>
</Container>
</Body>
</Tailwind>
</Html>
);
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function renderEmail(input: any, payload: any) {
return render(<ReactEmail {...input} {...payload} />);
}


void echo.workflow(
"weekly-email",
async ({ step, payload }) => {
await step.digest("weekly", async () => {
return {
amount: 2,
unit: "minutes",
};
});

await step.email("email", async (inputs) => {
return {
subject: "New updates",
body: renderEmail(inputs, payload),
};
});
},
{
payloadSchema: {
additionalProperties: true,
},
},
);
11 replies