fix(notif): include year in notifications (#1439)
* fix(notif): include year in notifications * fix(lang): fix shared overwritten strings * fix: check if email agent is actually enabled when generating passwords
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import logger from '../../logger';
|
||||
import { getSettings } from '../settings';
|
||||
import type { NotificationAgent, NotificationPayload } from './agents/agent';
|
||||
|
||||
export enum Notification {
|
||||
@@ -45,13 +44,13 @@ class NotificationManager {
|
||||
type: Notification,
|
||||
payload: NotificationPayload
|
||||
): void {
|
||||
const settings = getSettings().notifications;
|
||||
logger.info(`Sending notification(s) for ${Notification[type]}`, {
|
||||
label: 'Notifications',
|
||||
subject: payload.subject,
|
||||
});
|
||||
|
||||
this.activeAgents.forEach((agent) => {
|
||||
if (settings.enabled && agent.shouldSend(type)) {
|
||||
if (agent.shouldSend(type)) {
|
||||
agent.send(type, payload);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -179,7 +179,6 @@ interface NotificationAgents {
|
||||
}
|
||||
|
||||
interface NotificationSettings {
|
||||
enabled: boolean;
|
||||
agents: NotificationAgents;
|
||||
}
|
||||
|
||||
@@ -234,7 +233,6 @@ class Settings {
|
||||
initialized: false,
|
||||
},
|
||||
notifications: {
|
||||
enabled: true,
|
||||
agents: {
|
||||
email: {
|
||||
enabled: false,
|
||||
|
||||
Reference in New Issue
Block a user