Create push message content

Push message content specifies additional JSON content in the push notification payload that is sent to the push provider.

Before you begin

You must know how to use JSON with push messages.

Role required: admin or push_admin

About this task

The content layout defines the style of push notification that can be sent out. Push contents give you the opportunity to add content, such as a picture, as well as provide action buttons or icons. Use these in the script:
  • current: the properties of the current record.
  • message: the push message sent as the body of the entire push content.
  • attributes: the object of the push message attributes that you define.

Procedure

  1. Navigate to System Notification > Push > Push Message Content.
  2. Fill out the fields on the form (see table).
  3. Click Submit.
    Adding content with JSON
    Table 1. Notification Message form fields
    Field Description
    Name Enter a descriptive name for the layout.
    Push app The push application the content can be used with.
    Push Message Generation Enter a script that determines the layout. See the example scripts below.
    Related list
    Push Message Attribute Definitions Select the attributes that apply to this notification. Attributes can be a value or an action. These attributes are used as default values for the content items you create in the content script. However, any attributes you create with the push message can override these attributes. See Create an attribute definition for information on creating attributes.

Example

The following is an example of a content record that creates a two-button layout, one to approve something, such as a change request, and one to decline it.

var json = { 
  "table" : current.getTableName(), 
  "sys_id" : current.sys_id, 
  "template" : { 
    "type": "2 button", 
    "button1" : { 
      "title" : "Approve", 
      "action" : attributes.button_action, 
      "parameters" : { 
        "response" : "approve" 
       } 
     }, 
     "button2" : { 
       "title" : "Decline", 
       "action" : attributes.button_action, 
       "parameters" : { "response" : "decline" 
       } 
     } 
   } 
}; 
json;