You can set the templates directory to anything in plugin.json, I think it defaults to just templates if you don't specify.
Them you match the path from views, so it would be templates/emails where you put them.
If a user has the digest email set to daily / weekly / monthly , still gets notification emails each time a new event fires.
I was wondering if there is a way to avoid email notifications to be sent if the digest is different to "off"
maybe using one of these hooks?
filter:email.prepare
filter:email.cancel
filter:email.params
filter:email.modify
filter:email.send
Thanks for the help.
A user can select how they get notifications on the user settings. You can set the default settings for new users in the admin panel.
@PitaJ Thanks for the reply, but I'm actually looking to change the behavior nodebb has by default.
So I want users that choose to get notifications through email digest not ro receive email notifications. The users that don't choose email digest will get email notifications as usual.
So I was wondering which is the right hook to to this filter.
@Sebastián-Cisneros said in avoid nodebb send email notifications if daily digest is on:
filter:email.prepare
filter:email.cancel
filter:email.params
filter:email.modify
filter:email.send
are any of these filters the right way to get this done?
I guess the right one is this one
filter:email.cancel
accodring to nodebb documents
const result = await Plugins.hooks.fire('filter:email.cancel', {
cancel: false, // set to true in plugin to cancel sending email
template: template,
params: params,
});
right?