@wild-framework/notifications
v0.1.0
Published
Multi-channel notifications for Wild Framework.
Downloads
153
Maintainers
Readme
@wild-framework/notifications
Multi-channel notifications for Wild Framework.
Install
pnpm add @wild-framework/notificationsUsage
import { Notification, NotificationManager } from "@wild-framework/notifications";
class WelcomeNotification extends Notification {
via() { return ["mail", "database"] as const; }
toMail() { return { subject: "Welcome!", html: "<h1>Hello</h1>" }; }
toDatabase() { return { type: "welcome" }; }
}
const notifications = app.resolve(NotificationManager);
await notifications.send(user, new WelcomeNotification(user));License
MIT
