5. Notifications
All notification functions return void. Prefer the Async variants in all cases.
NotifyAsync(target, title, content, link, type)
async· returnsvoid
Sends an in-app notification to a specific user. The notification appears in the platform's notification center.
Prop
Type
await context.functions.NotifyAsync(
String(context.user.id),
"Document approved",
"Your contract has been approved and is ready to sign.",
"/contracts/" + context.record.ID,
"success"
);
NotifyGroupAsync(field, operator, value, title, content, link, type)
async· returnsvoid
Sends the same notification to a group of users filtered by a condition on their profile. One notification is delivered per matched user.
Prop
Type
await context.functions.NotifyGroupAsync(
"RoleId", "Equal", "1",
"System alert",
"A critical error occurred. Immediate action required.",
"/admin/errors",
"error"
);