lib/notifier
Type Aliases
Section titled “Type Aliases”AdminNotification
Section titled “AdminNotification”type AdminNotification = keyof AdminNotifications;
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:112
The type of the adminNotificationTypes
array.
EditorNotification
Section titled “EditorNotification”type EditorNotification = keyof EditorNotifications;
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:107
The type of the editorNotificationTypes
array.
UserNotification
Section titled “UserNotification”type UserNotification = keyof UserNotifications;
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:102
The type of the userNotificationTypes
array.
Variables
Section titled “Variables”notificationTitleStrings
Section titled “notificationTitleStrings”const notificationTitleStrings: Record<UserNotificationOptions, string>;
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:57
An object containing notification titles for each notification type.
notificationTypes
Section titled “notificationTypes”const notificationTypes: { admin: string[]; editor: string[]; user: string[];};
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:93
An object containing all notification types.
Type declaration
Section titled “Type declaration”admin: string[];
editor
Section titled “editor”editor: string[];
user: string[];
Functions
Section titled “Functions”sendAdminNotification()
Section titled “sendAdminNotification()”function sendAdminNotification<T, K>(notification: T, data: K): Promise<void>
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:292
Sends an admin notification if the mailer is enabled and the mail connection is verified.
Type Parameters
Section titled “Type Parameters”T
extends "user_updated"
| "user_deleted"
| "new_user"
The type of the admin notification.
K
extends string
The type of the data required by the notification.
Parameters
Section titled “Parameters”notification
Section titled “notification”T
The type of notification to send.
K
The data to include in the notification.
Returns
Section titled “Returns”Promise
<void
>
sendEditorNotification()
Section titled “sendEditorNotification()”function sendEditorNotification<T, K>(notification: T, data: K): Promise<void>
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:251
Sends an editor notification if the mailer is enabled and the mail connection is verified.
Type Parameters
Section titled “Type Parameters”T
extends
| "page_updated"
| "page_deleted"
| "new_page"
| "folder_updated"
| "folder_deleted"
| "new_folder"
The type of the editor notification.
K
extends string
The type of the data required by the notification.
Parameters
Section titled “Parameters”notification
Section titled “notification”T
The type of notification to send.
K
The data to include in the notification.
Returns
Section titled “Returns”Promise
<void
>
sendUserNotification()
Section titled “sendUserNotification()”function sendUserNotification<T>(notification: T, userId: string): Promise<void>
Defined in: studiocms/packages/studiocms/src/lib/notifier/index.ts:204
Sends a user notification if the mailer is enabled and the mail connection is verified.
Type Parameters
Section titled “Type Parameters”T
extends "account_updated"
The type of the user notification.
Parameters
Section titled “Parameters”notification
Section titled “notification”T
The notification to be sent.
userId
Section titled “userId”string
The ID of the user to whom the notification will be sent.
Returns
Section titled “Returns”Promise
<void
>
A promise that resolves when the notification is sent or if the mailer is disabled.