{"__v":7,"_id":"561dc41143c36d0d00da7798","category":{"__v":6,"_id":"561c7260cd5e7b0d00eb48c6","pages":["561c774b92a66f0d00987915","561c7c46be5c860d007bc1cd","561c7c6e2764990d00f546c4","561c7cc72764990d00f546c6","561dc41143c36d0d00da7798","563a920c0ed6332300378872"],"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,"project":"561c70aabe5fb20d00077758","user":"55d29988486de50d00327118","version":{"__v":6,"_id":"561c70aabe5fb20d0007775b","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-14T02:55:13.047Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Templating is a great way to personalize messages for users. With templating, you can insert any User Attribute into a message, and then when the user views the message, they see the current **value** of that attribute. Templating can be used in the title and body of In App Messages, and in Push Notifications.\n\nTemplates employ the use of double curly braces ('{{', '}}') to signify when an Attribute is used. \n\nHere's a simple example of how to greet a user by name: \n\n**Input:** `\"Hello, {{ custom.user_first_name }}!\"`\n\nThis simple template would look for a User Attribute with the key 'user_first_name' and then on a user basis, would replace it with the value (their name). This includes the double curly braces. \n\n**Output:** \"Hello, Sam!\"\n\nIf they don't have a value set, then you can use a default value. \n\n**Input:** `\"Hello {{ custom.first_name | default:'there'}}!\"`\n\n**Output:** \"Hello there!\"\n\nThis also doesn't apply to text, numbers and dates can be used too. \n\n**Input:** ```\"Hey {{ custom.first_name | default:'there'}}. We see you've purchased {{custom.total_purchases}} products so far, with the latest being {{custom.latest_purchased}}. How are you finding them? Please fill out [this survey](www.mycompany.com/survey) to tell us more!```\n\n**Output:** \"Hey Sam. We see you've purchased 9 products so far, with the latest being 5/5/2015. How are you finding them? Please fill out [this survey](www.mycompany.com/survey) to tell us more!\" (This example [uses markdown too](/marketers/messaging/using-markdown/)). We also see you're on version 4.9.2 so don't forget to update to version 5!\n\nFor In App Messages, we support even more of the [Liquid Templating Language](https://docs.shopify.com/themes/liquid-documentation/basics), so there's many more advanced techniques you can use such as conditional text, maths and iteration.\n\n Take a look, and if you need assistance, please [reach out to us](support:::at:::sailthru.com).","excerpt":"","slug":"using-personalization","type":"basic","title":"Using Personalization"}

Using Personalization


Templating is a great way to personalize messages for users. With templating, you can insert any User Attribute into a message, and then when the user views the message, they see the current **value** of that attribute. Templating can be used in the title and body of In App Messages, and in Push Notifications. Templates employ the use of double curly braces ('{{', '}}') to signify when an Attribute is used. Here's a simple example of how to greet a user by name: **Input:** `"Hello, {{ custom.user_first_name }}!"` This simple template would look for a User Attribute with the key 'user_first_name' and then on a user basis, would replace it with the value (their name). This includes the double curly braces. **Output:** "Hello, Sam!" If they don't have a value set, then you can use a default value. **Input:** `"Hello {{ custom.first_name | default:'there'}}!"` **Output:** "Hello there!" This also doesn't apply to text, numbers and dates can be used too. **Input:** ```"Hey {{ custom.first_name | default:'there'}}. We see you've purchased {{custom.total_purchases}} products so far, with the latest being {{custom.latest_purchased}}. How are you finding them? Please fill out [this survey](www.mycompany.com/survey) to tell us more!``` **Output:** "Hey Sam. We see you've purchased 9 products so far, with the latest being 5/5/2015. How are you finding them? Please fill out [this survey](www.mycompany.com/survey) to tell us more!" (This example [uses markdown too](/marketers/messaging/using-markdown/)). We also see you're on version 4.9.2 so don't forget to update to version 5! For In App Messages, we support even more of the [Liquid Templating Language](https://docs.shopify.com/themes/liquid-documentation/basics), so there's many more advanced techniques you can use such as conditional text, maths and iteration. Take a look, and if you need assistance, please [reach out to us](support@sailthru.com).