You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
778 B
22 lines
778 B
import {SendGridConfig, SendGridMail} from 'app/gen-server/lib/NotifierTypes';
|
|
|
|
export interface INotifier {
|
|
// for test purposes, check if any notifications are in progress
|
|
readonly testPending: boolean;
|
|
|
|
deleteUser(userId: number): Promise<void>;
|
|
|
|
// Intercept outgoing messages for test purposes.
|
|
// Return undefined if no notification system is available.
|
|
testSetSendMessageCallback(op: (body: SendGridMail, description: string) => Promise<void>): SendGridConfig|undefined;
|
|
}
|
|
|
|
/**
|
|
* A notifier that does nothing. Used when no email notifications are configured.
|
|
*/
|
|
export const EmptyNotifier: INotifier = {
|
|
get testPending() { return false; },
|
|
async deleteUser() { /* do nothing */ },
|
|
testSetSendMessageCallback() { return undefined; },
|
|
} as const;
|