mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(notifications): add option to send notifications for auto-approved requests
closes #267
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import logger from '../../logger';
|
||||
import { getSettings } from '../settings';
|
||||
import type { NotificationAgent, NotificationPayload } from './agents/agent';
|
||||
|
||||
export enum Notification {
|
||||
@@ -43,11 +44,12 @@ class NotificationManager {
|
||||
type: Notification,
|
||||
payload: NotificationPayload
|
||||
): void {
|
||||
const settings = getSettings().notifications;
|
||||
logger.info(`Sending notification for ${Notification[type]}`, {
|
||||
label: 'Notifications',
|
||||
});
|
||||
this.activeAgents.forEach((agent) => {
|
||||
if (agent.shouldSend(type)) {
|
||||
if (settings.enabled && agent.shouldSend(type)) {
|
||||
agent.send(type, payload);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user