{"_id":"561454290ab2550d00166d9d","__v":2,"category":{"_id":"54bb05cf9741c81500078f73","pages":["54bc3666e55d192000a62ef1","54bc89693e9c780c00303844","561454290ab2550d00166d9d","5614eaac8113d20d00082e6d"],"project":"53844557a43e08da4677be0e","version":"53844558a43e08da4677be12","__v":4,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-18T01:01:03.808Z","from_sync":false,"order":1,"slug":"integration-by-email-type","title":"Integration by email type"},"version":{"_id":"53844558a43e08da4677be12","__v":8,"project":"53844557a43e08da4677be0e","createdAt":"2014-05-27T07:57:12.136Z","releaseDate":"2014-05-27T07:57:12.136Z","categories":["53844558a43e08da4677be13","538619e1ef91f96d49aa1a0b","541e82877eb16bb64f83c0ca","5445a073c3eb3808000c76b2","5445a098c3eb3808000c76b3","54bb05ab522f03150054d9e8","54bb05cf9741c81500078f73","55b7d0e5568be2230092bb92"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"false","version_clean":"1.0.0","version":"1.0"},"project":"53844557a43e08da4677be0e","user":"5384345d90c19d5e43a8170c","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-06T23:07:21.036Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"STEP ONE - Turn on your Knowtify integration via Segment\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/NPsBYaj2Qqa0qzBlKAaR_skitch.png\",\n        \"skitch.png\",\n        \"288\",\n        \"105\",\n        \"#5ecc5e\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThis will start shipping all your Segment events to Knowtify. As users use your application, contact records will be created in Knowtify and data from any events they trigger will be recorded under those user profiles. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"STEP TWO - Create a Notification email template in Knowtify\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/374OHaQ1TKS15JidLcUd_skitch.png\",\n        \"skitch.png\",\n        \"1239\",\n        \"671\",\n        \"#e75054\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou will use our email designer to create a template for your transactional emails (be sure to select a Notification email). \n\nYou will be inserting {merge_tags} for any variable, personalized content that will be contained in the event data. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"STEP THREE - Tag your email template with the name of the Segment event\"\n}\n[/block]\nIn your .track call, you will have a name of the event. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"  analytics.track('new_job_request', {\\n        category: 'Action',\\n        requester_name: 'Sally Knowne',\\n        job_name: 'Babysitting'\\n      });\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nIn this case, it's 'new_job_request'.\n\nYou will simply enter this event name in the Event Tag box on the Delivery tab of your email template. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/wO3KQmgPRqvWSgdKThY4_skitch.png\",\n        \"skitch.png\",\n        \"1276\",\n        \"614\",\n        \"#c45169\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThis tells Knowtify to ship this email every time this event occurs. The email is delivered to whatever user* is referenced in the .track call. \n\n*This means if you want an email delivered to a user that didn't actually trigger the event (for example, a user requested a job, but you want an email to go out to the person who will fulfill the job), then you need to have a .track event referencing that other user.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"STEP FOUR (Optional) - Set rules for your notification\"\n}\n[/block]\nIf you want, you can create rules to filter who should receive your notifications (ie - only people with a user-type of Admin, or only people who haven’t logged in in 2 days, etc), you can do that here as well. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/mkpWnhplTXxKWKRd28SN_skitch.png\",\n        \"skitch.png\",\n        \"595\",\n        \"368\",\n        \"#a3543b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"STEP FIVE - Turn email LIVE\"\n}\n[/block]\nOnce you are ready, you can turn your email LIVE and it will begin delivering as soon as those events are triggered. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/YmToMWi0Q2yQ7muZn36A_skitch.png\",\n        \"skitch.png\",\n        \"1260\",\n        \"555\",\n        \"#bb5668\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"A quick guide for sending transactional/notification emails directly from Segment.","slug":"transactional-emails-with-segment","type":"basic","title":"TRANSACTIONAL EMAILS WITH SEGMENT"}

TRANSACTIONAL EMAILS WITH SEGMENT

A quick guide for sending transactional/notification emails directly from Segment.

[block:api-header] { "type": "basic", "title": "STEP ONE - Turn on your Knowtify integration via Segment" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/NPsBYaj2Qqa0qzBlKAaR_skitch.png", "skitch.png", "288", "105", "#5ecc5e", "" ] } ] } [/block] This will start shipping all your Segment events to Knowtify. As users use your application, contact records will be created in Knowtify and data from any events they trigger will be recorded under those user profiles. [block:api-header] { "type": "basic", "title": "STEP TWO - Create a Notification email template in Knowtify" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/374OHaQ1TKS15JidLcUd_skitch.png", "skitch.png", "1239", "671", "#e75054", "" ] } ] } [/block] You will use our email designer to create a template for your transactional emails (be sure to select a Notification email). You will be inserting {merge_tags} for any variable, personalized content that will be contained in the event data. [block:api-header] { "type": "basic", "title": "STEP THREE - Tag your email template with the name of the Segment event" } [/block] In your .track call, you will have a name of the event. [block:code] { "codes": [ { "code": " analytics.track('new_job_request', {\n category: 'Action',\n requester_name: 'Sally Knowne',\n job_name: 'Babysitting'\n });", "language": "javascript" } ] } [/block] In this case, it's 'new_job_request'. You will simply enter this event name in the Event Tag box on the Delivery tab of your email template. [block:image] { "images": [ { "image": [ "https://files.readme.io/wO3KQmgPRqvWSgdKThY4_skitch.png", "skitch.png", "1276", "614", "#c45169", "" ] } ] } [/block] This tells Knowtify to ship this email every time this event occurs. The email is delivered to whatever user* is referenced in the .track call. *This means if you want an email delivered to a user that didn't actually trigger the event (for example, a user requested a job, but you want an email to go out to the person who will fulfill the job), then you need to have a .track event referencing that other user. [block:api-header] { "type": "basic", "title": "STEP FOUR (Optional) - Set rules for your notification" } [/block] If you want, you can create rules to filter who should receive your notifications (ie - only people with a user-type of Admin, or only people who haven’t logged in in 2 days, etc), you can do that here as well. [block:image] { "images": [ { "image": [ "https://files.readme.io/mkpWnhplTXxKWKRd28SN_skitch.png", "skitch.png", "595", "368", "#a3543b", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "STEP FIVE - Turn email LIVE" } [/block] Once you are ready, you can turn your email LIVE and it will begin delivering as soon as those events are triggered. [block:image] { "images": [ { "image": [ "https://files.readme.io/YmToMWi0Q2yQ7muZn36A_skitch.png", "skitch.png", "1260", "555", "#bb5668", "" ] } ] } [/block]