christian
christian
NNovu
Created by christian on 12/9/2024 in #💬│support
Rate limit for topic email
I use a topic for sending out a weekly e-mail, I got this response from resend for most of the emails

"Too many requests. You can only make 2 requests per second. See rate limit response headers for more information. Or contact support to increase rate limit."

"Too many requests. You can only make 2 requests per second. See rate limit response headers for more information. Or contact support to increase rate limit."
I guess what I'm asking for is if I can add some kind of delay so that not all e-mails are sent at the same time for the topic, perhaps i could do this by adding a random delay in my workflow?
export const topRecipesWorkflow = workflow(
TriggerEvents.TopWeekly,
async ({ step, payload, subscriber }) => {
const recipes = JSON.parse(payload.recipes ?? "[]");
const userId = subscriber.subscriberId ?? "";
const userFirstName = subscriber.firstName ?? "";

await step.email("weekly-top-recipes", async () => {
const emailBody = await renderEmail(recipes, userId, userFirstName);
return {
subject: "Top recipes last week",
body: emailBody,
};
});
},
{
payloadSchema: topWeeklyPayloadSchema,
},
);
export const topRecipesWorkflow = workflow(
TriggerEvents.TopWeekly,
async ({ step, payload, subscriber }) => {
const recipes = JSON.parse(payload.recipes ?? "[]");
const userId = subscriber.subscriberId ?? "";
const userFirstName = subscriber.firstName ?? "";

await step.email("weekly-top-recipes", async () => {
const emailBody = await renderEmail(recipes, userId, userFirstName);
return {
subject: "Top recipes last week",
body: emailBody,
};
});
},
{
payloadSchema: topWeeklyPayloadSchema,
},
);
11 replies
NNovu
Created by christian on 12/9/2024 in #💬│support
Rate limit for topic email
ok thanks
11 replies
NNovu
Created by christian on 12/2/2024 in #💬│support
Using global preferences
Thanks @Pawan Jain 👌🏻
4 replies
NNovu
Created by christian on 12/2/2024 in #💬│support
Using global preferences
Any ideas?
4 replies
NNovu
Created by christian on 12/2/2024 in #💬│support
Using Subscriber in Topic trigger
I think it's working and the problem was on my side 🙂 btw: get subscriber api
Query Parameters
includeTopics
string
Includes the topics associated with the subscriber
Query Parameters
includeTopics
string
Includes the topics associated with the subscriber
should be boolean
8 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
same :/
17 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
export async function getSubscriberPreferences({
subscriberId,
}: GetSubscriberPreferencesParams) {
const response = await novu.subscribers.getPreference(subscriberId, {
includeInactiveChannels: false,
});

return response.data;
}



@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
export async function getSubscriberPreferences({
subscriberId,
}: GetSubscriberPreferencesParams) {
const response = await novu.subscribers.getPreference(subscriberId, {
includeInactiveChannels: false,
});

return response.data;
}



@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
@app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
17 replies
NNovu
Created by christian on 12/2/2024 in #💬│support
Using Subscriber in Topic trigger
yes userid and firstname is empty, I will try to debug it to see if there's anything in the subscriber object
8 replies
NNovu
Created by christian on 12/2/2024 in #💬│support
Using Subscriber in Topic trigger
yes this is my workflow
import { renderEmail } from "@kickstarted/email/emails/top-recipes";
import { workflow } from "@novu/framework";
import { TriggerEvents, topWeeklyPayloadSchema } from "../schemas";

export const topRecipesWorkflow = workflow(
TriggerEvents.TopWeekly,
async ({ step, payload, subscriber }) => {
const recipes = JSON.parse(payload.recipes ?? "[]");
const userId = subscriber.subscriberId ?? "";
const userFirstName = subscriber.firstName ?? "";

await step.email("weekly-top-recipes", async () => {
const emailBody = await renderEmail(recipes, userId, userFirstName);
return {
subject: "Top recipes last week",
body: emailBody,
};
});
},
{
payloadSchema: topWeeklyPayloadSchema,
},
);
import { renderEmail } from "@kickstarted/email/emails/top-recipes";
import { workflow } from "@novu/framework";
import { TriggerEvents, topWeeklyPayloadSchema } from "../schemas";

export const topRecipesWorkflow = workflow(
TriggerEvents.TopWeekly,
async ({ step, payload, subscriber }) => {
const recipes = JSON.parse(payload.recipes ?? "[]");
const userId = subscriber.subscriberId ?? "";
const userFirstName = subscriber.firstName ?? "";

await step.email("weekly-top-recipes", async () => {
const emailBody = await renderEmail(recipes, userId, userFirstName);
return {
subject: "Top recipes last week",
body: emailBody,
};
});
},
{
payloadSchema: topWeeklyPayloadSchema,
},
);
8 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
I'll just use the api instead
17 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
it's not working for me with using fetch and api:
app:dev: { email: true, in_app: true }
app:dev: { in_app: true }
app:dev: { in_app: true }
app:dev: { email: true }
app:dev: { in_app: true }
app:dev: { email: true, in_app: true }
app:dev: { in_app: true }
app:dev: { in_app: true }
app:dev: { email: true }
app:dev: { in_app: true }
using client:
export async function getSubscriberPreferences({
subscriberId,
}: GetSubscriberPreferencesParams) {
const response = await novu.subscribers.getPreference(subscriberId, {
includeInactiveChannels: false,
});
return response.data;
}

app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
export async function getSubscriberPreferences({
subscriberId,
}: GetSubscriberPreferencesParams) {
const response = await novu.subscribers.getPreference(subscriberId, {
includeInactiveChannels: false,
});
return response.data;
}

app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
app:dev: { email: true, sms: true, in_app: true, chat: true, push: true }
17 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
think it'll be ready today @Pawan Jain , sorry to bother but in the current state my app is broken
17 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
Would be nice to get this in a version soon, the api changes broke my application and I don't want to move from using the client.
17 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
will it be merged today?
17 replies
NNovu
Created by christian on 11/24/2024 in #💬│support
Changes to getPreference()?
ok so I need to wait for the PR to be merged in order to fix this since I'm using the novu client
17 replies
NNovu
Created by christian on 11/20/2024 in #💬│support
Bug in docs
Noticed it because I use almost exactly this example in my application. Such an easy way of performing what could be a complex task. Thank you for this product
6 replies
NNovu
Created by christian on 11/14/2024 in #💬│support
Problem with PATCH subscriber
now its working, probably a glitch of some sort?
{"data":{"preference":{"channels":{"in_app":true},"enabled":true},"template":{"_id":"672b8e95453679ea5584c82e","name":"recipe_comment_new_in_app","critical":false,"triggers":[{"identifier":"recipe_comment_new_in_app","type":"event","variables":[]}]}}}⏎
{"data":{"preference":{"channels":{"in_app":true},"enabled":true},"template":{"_id":"672b8e95453679ea5584c82e","name":"recipe_comment_new_in_app","critical":false,"triggers":[{"identifier":"recipe_comment_new_in_app","type":"event","variables":[]}]}}}⏎
4 replies
NNovu
Created by christian on 11/14/2024 in #💬│support
Problem with PATCH subscriber
Is it a bug ?
4 replies