Nitin
Nitin
NNovu
Created by Nitin on 1/23/2024 in #💬│support
Date Range filtering for In-App notifications
Yes yes sure. Do I share here only or is there a separate thread / channel for it?
9 replies
NNovu
Created by Nitin on 1/23/2024 in #💬│support
Date Range filtering for In-App notifications
@Emil I also thought the same but seems like we have a lot of data (1000+ notifications per account) and it is growing more every day. So somewhere I feel that doing either server-side or client side rendering with increasing data will increase the load gradually and is not an optimal way 😓
9 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
Thanks @Pawan Jain for the help and resolution 🙏
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
Hey @jainpawan21 , I cannot find the mention of this issue's fix in the release docs: https://github.com/novuhq/novu/releases/tag/v0.20.0 Can you please once confirm if it went live or not?
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
Okay, please let me know whenever this is merged.
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
Hey @Pawan Jain thanks for the update and fixing this 🙏 . Any idea when will be the next release made?
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
@Pawan Jain any updates here?
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
Hey @Pawan Jain , thanks for helping out here. Do let me know whenever the fix is live.
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
Hosted version is 0.13. I just checked and realised that someone else from the team has updated the package version to 0.18. But the hosted version is not changed and is still on 0.13 Do you think this might be because of that?
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
I am triggering notification as subscriberId array, like this:
public async triggerNotificationToNovu({ triggerId, sendTo, payload: notificationPayload }: NovuRepoParams) {
const { payload } = notificationPayload;
if (sendTo.length === 0) {
throw new Error('No users found to send notification to');
}
const subscribers = sendTo.map((s) => ({ subscriberId: s }));
try {
const novuResponse = await this.novu.trigger(triggerId, {
to: subscribers,
payload: payload,
});
const { acknowledged, status, transactionId } = novuResponse.data.data;
return {
acknowledged,
status,
transactionId,
};
} catch (e) {
throw new Error(`Error while sending notification to Novu: ${e.message}`);
}
}
public async triggerNotificationToNovu({ triggerId, sendTo, payload: notificationPayload }: NovuRepoParams) {
const { payload } = notificationPayload;
if (sendTo.length === 0) {
throw new Error('No users found to send notification to');
}
const subscribers = sendTo.map((s) => ({ subscriberId: s }));
try {
const novuResponse = await this.novu.trigger(triggerId, {
to: subscribers,
payload: payload,
});
const { acknowledged, status, transactionId } = novuResponse.data.data;
return {
acknowledged,
status,
transactionId,
};
} catch (e) {
throw new Error(`Error while sending notification to Novu: ${e.message}`);
}
}
21 replies
NNovu
Created by Nitin on 10/11/2023 in #💬│support
Delete Multiple Transactions not working.
Hey @Pawan Jain .
public async removeNotificationFromNovu(transactionId: string) {
try {
console.log('To delete transaction Id: ', transactionId);
// const API_URL = `${this.BACKEND_URL}/v1/events/trigger/${transactionId}`;
// const headers = {
// 'Content-Type': 'application/json',
// Authorization: `ApiKey ${this.API_KEY}`,
// };
// const resp = await axios.delete(API_URL, { headers });
const resp = await this.novu.events.cancel(transactionId);
console.log('API RESP: ', resp.status, resp.data);
if (resp.status !== 200) {
throw new Error(`Error while deleting notification: ${resp.statusText}`);
}
if (resp.data?.data) {
return {
message: 'success',
};
}
return {
message: 'Failure. No notification found for the given transactionId',
};
} catch (e: any) {
throw new Error(`Error while calling delete notification API: ${e.message}`);
}
}
public async removeNotificationFromNovu(transactionId: string) {
try {
console.log('To delete transaction Id: ', transactionId);
// const API_URL = `${this.BACKEND_URL}/v1/events/trigger/${transactionId}`;
// const headers = {
// 'Content-Type': 'application/json',
// Authorization: `ApiKey ${this.API_KEY}`,
// };
// const resp = await axios.delete(API_URL, { headers });
const resp = await this.novu.events.cancel(transactionId);
console.log('API RESP: ', resp.status, resp.data);
if (resp.status !== 200) {
throw new Error(`Error while deleting notification: ${resp.statusText}`);
}
if (resp.data?.data) {
return {
message: 'success',
};
}
return {
message: 'Failure. No notification found for the given transactionId',
};
} catch (e: any) {
throw new Error(`Error while calling delete notification API: ${e.message}`);
}
}
21 replies