{"_id":"5701977af55ce10e0030c293","project":"561c70aabe5fb20d00077758","__v":11,"category":{"_id":"561c7260cd5e7b0d00eb48c6","pages":["561c774b92a66f0d00987915","561c7c46be5c860d007bc1cd","561c7c6e2764990d00f546c4","561c7cc72764990d00f546c6","561dc41143c36d0d00da7798","563a920c0ed6332300378872"],"__v":6,"project":"561c70aabe5fb20d00077758","version":"561c70aabe5fb20d0007775b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-13T02:54:24.912Z","from_sync":false,"order":1,"slug":"messaging","title":"Messaging"},"parentDoc":null,"version":{"_id":"561c70aabe5fb20d0007775b","__v":6,"project":"561c70aabe5fb20d00077758","createdAt":"2015-10-13T02:47:06.824Z","releaseDate":"2015-10-13T02:47:06.824Z","categories":["561c70abbe5fb20d0007775c","561c725c4b0a9b0d00c0f515","561c7260cd5e7b0d00eb48c6","561c726bf0e0580d00ddd9a4","561c7271d2fb350d004bf89a","564de219b5bea52b00c3457a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"55d2bd8e2463351700f67dd7","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-03T22:21:46.103Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"A Carnival message has the default fields of _title_, _body_,  _URL_, _image_ or _video_.    Carnival allows marketers to add additional *Message Attributes* to an in-app message, to give complete control over the look, feel, and behavior of in-app notifications and the Message Stream.  This includes:\n\n- Message categories (announcements, deals, updates)\n- Sticky messages (ones that always appear first) \n- Message labels and headings (labels which have different UI treatment to the default fields) \n- Pinned posts (messages that can’t be deleted)\n- Call-To-Actions on messages\n- Dynamic coupon codes (when coupled with [personalization](doc:using-personalization))\n\nFor example, a shopping app might choose to emphasize the price, product and category on a message card.  A game might have a character name or a number of bonus coins to unlock after a user taps on the message. \n\n## Example 1: Sticky Messages and multiple Message Streams \n\nBy adding new Message Attributes of `category` and `is_sticky`, it is possible to create a Message Stream with multiple categories, and have 'sticky' messages which are always shown at the top, regardless of publish date.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/uO5vCuURQIe9aZnOzfps_filter-stream.png\",\n        \"filter-stream.png\",\n        \"569\",\n        \"1172\",\n        \"#775c4b\",\n        \"\"\n      ],\n      \"caption\": \"An example of multiple Message Streams and a 'sticky message'.\"\n    }\n  ]\n}\n[/block]\n## Example 2: Call to action\n \nBy adding new Message Attributes of `cta_url`, `was_price` and `now_price`, it is possible to create a custom Message interface, similar to the image below.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/FD1o6jq0RMusCMunX3rm_cta.png\",\n        \"cta.png\",\n        \"569\",\n        \"1172\",\n        \"#975c39\",\n        \"\"\n      ],\n      \"caption\": \"A message including a CTA and custom price labels.\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Getting Started\"\n}\n[/block]\n1. The app developer needs to code the custom interface and behavior around the message attributes your app will support.\n2. Add these new Message Attribute fields to your app within the Settings/Developer area.  These new fields will then show up whenever composing an in-app message, as shown in the image below.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3d7f118-Screen_Shot_2017-03-02_at_11.45.19_AM.png\",\n        \"Screen Shot 2017-03-02 at 11.45.19 AM.png\",\n        638,\n        755,\n        \"#e0e8ee\"\n      ],\n      \"caption\": \"A compose message window, with additional message attributes of 'price' and 'category'.\"\n    }\n  ]\n}\n[/block]","excerpt":"Add additional fields to your in-app messages to create custom message interfaces.","slug":"message-attributes","type":"basic","title":"Message Attributes"}

Message Attributes

Add additional fields to your in-app messages to create custom message interfaces.

A Carnival message has the default fields of _title_, _body_, _URL_, _image_ or _video_. Carnival allows marketers to add additional *Message Attributes* to an in-app message, to give complete control over the look, feel, and behavior of in-app notifications and the Message Stream. This includes: - Message categories (announcements, deals, updates) - Sticky messages (ones that always appear first) - Message labels and headings (labels which have different UI treatment to the default fields) - Pinned posts (messages that can’t be deleted) - Call-To-Actions on messages - Dynamic coupon codes (when coupled with [personalization](doc:using-personalization)) For example, a shopping app might choose to emphasize the price, product and category on a message card. A game might have a character name or a number of bonus coins to unlock after a user taps on the message. ## Example 1: Sticky Messages and multiple Message Streams By adding new Message Attributes of `category` and `is_sticky`, it is possible to create a Message Stream with multiple categories, and have 'sticky' messages which are always shown at the top, regardless of publish date. [block:image] { "images": [ { "image": [ "https://files.readme.io/uO5vCuURQIe9aZnOzfps_filter-stream.png", "filter-stream.png", "569", "1172", "#775c4b", "" ], "caption": "An example of multiple Message Streams and a 'sticky message'." } ] } [/block] ## Example 2: Call to action By adding new Message Attributes of `cta_url`, `was_price` and `now_price`, it is possible to create a custom Message interface, similar to the image below. [block:image] { "images": [ { "image": [ "https://files.readme.io/FD1o6jq0RMusCMunX3rm_cta.png", "cta.png", "569", "1172", "#975c39", "" ], "caption": "A message including a CTA and custom price labels." } ] } [/block] [block:api-header] { "type": "basic", "title": "Getting Started" } [/block] 1. The app developer needs to code the custom interface and behavior around the message attributes your app will support. 2. Add these new Message Attribute fields to your app within the Settings/Developer area. These new fields will then show up whenever composing an in-app message, as shown in the image below. [block:image] { "images": [ { "image": [ "https://files.readme.io/3d7f118-Screen_Shot_2017-03-02_at_11.45.19_AM.png", "Screen Shot 2017-03-02 at 11.45.19 AM.png", 638, 755, "#e0e8ee" ], "caption": "A compose message window, with additional message attributes of 'price' and 'category'." } ] } [/block]