Notif Class Reference
Notif.sendNow(message, emails) Notif.sendAtDate(message, emails, date) Notif.updateId(id, field, value) Notif.deleteId(id) |
Notif.sendNow(message, emails)
Sends a push notification to users in the same Upvise account database.
- message a a JSON object containing the following fields
- id (string) is the message unique id
- title (string) is the notification title
- body (string) is the notification content. Can inclde carriage returns \r\n
- onclick (string) is the function call to exeucte in Upvise when the user clicks on the notification
- type (string) is optional field to specify the notificaiton type, used to filter notifications
- emails (string) is the recipient list of emails separated by a semi colimn. If null or "" is passet, the notification is sent to all managers
var message = {id: "23455", title: "Invoice Paid", body: "#Number:2014-5443", onclick: "Sales.viewInvoice({id})", type:"invoice" }; var emails = ""; // send to all managers Notif.sendNow(message, emails)
Notif.sendAtDate(message, emails, date)
Sends a push notification to users at a specified date
- message a a JSON object containing the following fields
- id (string) is the message unique id
- title (string) is the notification title
- body (string) is the notification content. Can inclde carriage returns \r\n
- onclick (string) is the function call to exeucte in Upvise when the user clicks on the notification
- type (string) is optional field to specify the notificaiton type, used to filter notifications
- emails (string) is the recipient list of emails separated by a semi colimn. If null or "" is passet, the notification is sent to all managers
- date (number) is the date in EPOCH format when to send the message
var message = {id: "23455", title: "Invoice Paid", body: "#Number:2014-5443", onclick: "Sales.viewInvoice({id})", type:"invoice" }; var emails = ""; // send to all managers var date = Date.now() + 2*Date.HOUR; Notif.sendAtDate(message, emails, date)