diff --git a/notifications/notification-utils.ts b/notifications/notification-utils.ts index acf328da..9979aeb3 100644 --- a/notifications/notification-utils.ts +++ b/notifications/notification-utils.ts @@ -3,6 +3,7 @@ import {HelperFunctions} from "../utils/HelperFunctions.class"; import {Composer} from "../utils/email/composer"; export class NotificationUtils { + public static IMPORT_INDICATORS: Notification = new Notification('IMPORT', ['monitor'], 'User ((__user__)) has imported new indicators in ((__stakeholder__)) profile', 'section') public static CREATE_STAKEHOLDER: Notification = new Notification('CREATE', ['monitor'], 'User ((__user__)) has created a new profile', 'stakeholder') public static EDIT_STAKEHOLDER: Notification = new Notification('EDIT', ['monitor'], 'User ((__user__)) has updated ((__stakeholder__)) profile', 'stakeholder') public static CREATE_INDICATOR: Notification = new Notification('CREATE', ['monitor'], 'User ((__user__)) has created a new indicator in ((__stakeholder__)) profile', 'indicator'); @@ -11,6 +12,13 @@ export class NotificationUtils { public static INVITE_MONITOR_MANAGER: Notification = new Notification('INVITE_MANAGER', ['monitor'], null, 'user'); public static INVITE_MONITOR_MEMBER: Notification = new Notification('INVITE_MEMBER', ['monitor'], null, 'user'); + public static importIndicators(user: string, stakeholder: string): Notification { + let notification: Notification = HelperFunctions.copy(this.IMPORT_INDICATORS); + notification.message = notification.message.replace('((__user__))', user); + notification.message = notification.message.replace('((__stakeholder__))', stakeholder); + return notification; + } + public static createStakeholder(user: string): Notification { let notification: Notification = HelperFunctions.copy(this.CREATE_STAKEHOLDER); notification.message = notification.message.replace('((__user__))', user);