feat: enhance email notification system with tracking and feedback

- Introduced a new feature to track email statuses by implementing a mapping of email IDs.
- Added a query to fetch email statuses based on tracked IDs, improving the monitoring of email delivery.
- Enhanced the logging system for email and chat notifications, providing detailed feedback on the sending process.
- Implemented user feedback messages for various actions, improving the overall user experience.
- Refactored the notification sending logic to support better error handling and status updates.
This commit is contained in:
2025-11-04 00:19:35 -03:00
parent ce24190b1a
commit 7fb1693717
2 changed files with 387 additions and 47 deletions

View File

@@ -218,6 +218,25 @@ export const getEmailById = internalQuery({
},
});
/**
* Buscar emails por IDs (query pública)
*/
export const buscarEmailsPorIds = query({
args: {
emailIds: v.array(v.id("notificacoesEmail")),
},
handler: async (ctx, args) => {
const emails = [];
for (const emailId of args.emailIds) {
const email = await ctx.db.get(emailId);
if (email) {
emails.push(email);
}
}
return emails;
},
});
export const getActiveEmailConfig = internalQuery({
args: {},
// Tipo inferido automaticamente pelo Convex