Notifications
sendPushNotification, sendPersistentNotification, sendEmail, sendSms
Global functions available to smart-app code. Call them by bare name; there is no object to import.
| Function | Summary |
|---|---|
sendPushNotification | Send a push notification to the account's users. |
sendPersistentNotification | Post a notification that stays in the app’s notification centre until the user dismisses it. |
sendEmail | Send an email via the cloud (AWS SES). |
sendSms | Send an SMS via the cloud (Twilio). |
sendPushNotification
Send a push notification to the account's users.
critical: trueasks for TIME-SENSITIVE delivery (iOSinterruption-level: time-sensitive, Android high priority): the push arrives promptly even under Focus / Doze, but it never bypasses Do Not Disturb — that tier is reserved for real alarms raised by the security system. -userIds(optional) narrows the fan-out to those account users. Omit (or pass empty) to fan out to every user on the account — the legacy behavior. The cloud rejects userIds that don't belong to the hub's account.
Signature
function sendPushNotification(message: string, title?: string, critical?: boolean, userIds?: string[]): voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
message | string | yes | — | Body text. Empty strings are ignored. |
title | string | no | 'Notification from NOVON Edge Device' | Notification title. |
critical | boolean | no | false | true requests time-sensitive delivery (prompt under Focus / Doze). Never bypasses Do Not Disturb; that tier is reserved for alarms. |
userIds | string[] | no | undefined | Restrict delivery to these account users. Omit or pass [] for everyone on the account. Use an accountUserId input to let the installer pick. |
Returns
void
Examples
sendPushNotification(`${evt.entityId} opened while away`, 'Security', true, $g.recipients);See also
sendPersistentNotification · notifications
sendPersistentNotification
Post a notification that stays in the app’s notification centre until the user dismisses it.
Signature
function sendPersistentNotification(message: string, title?: string): voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
message | string | yes | — | Body text. |
title | string | no | 'Notification from NOVON Edge Device' | Title. |
Returns
void
See also
sendEmail
Not available to AI-generated user automations.
Send an email via the cloud (AWS SES). Fire-and-forget — smart-app callers don't get delivery confirmation. The hub validates the address before forwarding, and the cloud handler logs failures.
Signature
function sendEmail(to: string, subject: string, body: string): voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
to | string | yes | — | Recipient address; the hub validates it before forwarding. |
subject | string | yes | — | Subject line. |
body | string | yes | — | Plain-text body. |
Returns
void
Notes
- Not available to AI-generated user automations.
See also
sendSms
Not available to AI-generated user automations.
Send an SMS via the cloud (Twilio). Fire-and-forget. The cloud handler normalizes the phone number (digits only, drops leading country-code 1) before handing off. US 10-digit numbers only.
Signature
function sendSms(to: string, message: string): voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
to | string | yes | — | US 10-digit number; a leading country code 1 is stripped. |
message | string | yes | — | Message text. |
Returns
void
Notes
- Not available to AI-generated user automations.