{"__v":0,"_id":"5719767ec863120e0012a054","category":{"version":"5719767ec863120e0012a042","project":"56008ba98c0c9d0d00dcaeb0","_id":"5719767ec863120e0012a048","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-03T23:58:04.955Z","from_sync":false,"order":3,"slug":"techy-questions","title":"Techie Questions"},"parentDoc":null,"project":"56008ba98c0c9d0d00dcaeb0","user":"56008b651503430d007cc929","version":{"__v":3,"_id":"5719767ec863120e0012a042","hasDoc":true,"hasReference":true,"project":"56008ba98c0c9d0d00dcaeb0","createdAt":"2016-04-22T00:55:26.295Z","releaseDate":"2016-04-22T00:55:26.295Z","categories":["5719767ec863120e0012a043","5719767ec863120e0012a044","5719767ec863120e0012a045","5719767ec863120e0012a046","5719767ec863120e0012a047","5719767ec863120e0012a048","5719767ec863120e0012a049","57f45a18da14e71700d12e4a","582b71b15403840f008c0410"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-22T00:00:34.861Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Many applications have a simple \"one website with many users\" relationship. Other applications have what is called \"multi-tenancy\". There is one website, with a tenant, and that tenant has its own distinct set of users.\n\nFor example, Google for Work is an application. It has many customers, like FedEx. And FedEx on Google for Work has their own set of users.\n\nIf this sounds like you, keep on reading to learn how ThisData can work for you. If not, you should be all set to get started by [Sending your first Event using CURL](doc:sending-your-first-event-to-thisdata-from-the-command-line-with-curl)!\n\n# The default \n\nBy default, emails are sent from `Your Company Name <security:::at:::thisdata.com>`. Your name and logo are also displayed in the email. These settings are all found, and can be customized, within the ThisData app.\n\nThese settings will apply to all events by default.\n\n# How do I customize individual notifications?\n\nFor multi-tenanted applications, you need to send customization details with _every_ event you want to customize. You must *always* pass a non-blank name for those customized events.\n\nFor example, let's say your ThisData account is called \"DemoCo\". When a user is interacting with Tenant X, send details about Tenant X in the event payload. If they are interacting with Tenant Y, send details about Tenant Y.\n\nThe [Events API](doc:apiv1events) has details on the `source` attribute you must use to achieve this customization.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"You'll need to be Golden!\",\n  \"body\": \"Per-event customization / multi-tenanting is available on all our Gold plans and above.\"\n}\n[/block]\n# Example\n\nIf an event looks unusual and triggers a _\"Was this you?\" email, we will look at the details in that event payload. \n\n## Without sending tenant information:\n\n```\ncurl -XPOST 'https://api.thisdata.com/v1/events.json?api_key=abc123' -d '{\n  \"ip\" : \"130.216.39.241\",\n  \"verb\" : \"log-in\",\n  \"user_agent\" : \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36\",\n  \"user\" : {\n    \"id\"     : \"112233\",\n    \"name\"   : \"Logan Brown\",\n    \"email\"  : \"logan.brown@example.com\",\n    \"mobile\" : \"+64270000001\"\n  }\n}'\n```\n\n> _Did you just log in to DemoCo from San Francisco, CA?_\n\n## With Tenant Information\n\n```\ncurl -XPOST 'https://api.thisdata.com/v1/events.json?api_key=abc123' -d '{\n  \"ip\" : \"130.216.39.241\",\n  \"verb\" : \"log-in\",\n  \"user_agent\" : \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36\",\n  \"user\" : {\n    \"id\"     : \"112233\",\n    \"name\"   : \"Logan Brown\",\n    \"email\"  : \"logan.brown@example.com\",\n    \"mobile\" : \"+64270000001\"\n  },\n  \"source\" : {\n    \"name\" : \"Tenant Y\",\n    \"logo_url\" : \"https://tenanty.democo.com/logo.png\"\n  }\n}'\n```\n\n> _Did you log in to Tenant Y from San Francisco, CA?_\n\n# What can I customize?\n\n### Name\n\nUse `source[name]` to customize the name shown in the Was This You notifications. This applies to both email and SMS where applicable.\n\n### Logo in the Was This You? email\n\nUse `source[logo_url]` to customize the logo shown in the top right of the Was This You? notification. (SMS messages do not contain an image.)\n\n**Currently you must also pass a non-blank `source[\"name\"]` for us to use the `logo_url`.**\n\n# What happens if I don't pass a Name or Logo URL?\n\nIf you pass a null or blank `name`, we will not do anything with the multi-tenant source information. Any notifications will look like normal - using your account name and, if you uploaded one in the API Settings page, the logo image in the Was This You emails.\n\nIf you pass a custom name, and no `logo_url`, we will use the custom name in Email and SMS notifications. In the Email we will use the default logo you have uploaded in the API Settings, if you uploaded one.\n\nIf you pass a null or blank `name`, and *do* pass a `logo_url`, we currently won't use that logo.\n\n# How do I get access to per-event customization / multi-tenanting?\n\nPer-event customization / multi-tenanting is available on all our Gold plans and above. It can require a small amount of work to properly configure, so  [contact us now](mailto:sales@thisdata.com) to begin the process.","excerpt":"If your application is multi-tenanted, learn how to customize the Was This You emails","slug":"multi-tenanted-applications","type":"basic","title":"Multi-Tenanted Applications"}

Multi-Tenanted Applications

If your application is multi-tenanted, learn how to customize the Was This You emails

Many applications have a simple "one website with many users" relationship. Other applications have what is called "multi-tenancy". There is one website, with a tenant, and that tenant has its own distinct set of users. For example, Google for Work is an application. It has many customers, like FedEx. And FedEx on Google for Work has their own set of users. If this sounds like you, keep on reading to learn how ThisData can work for you. If not, you should be all set to get started by [Sending your first Event using CURL](doc:sending-your-first-event-to-thisdata-from-the-command-line-with-curl)! # The default By default, emails are sent from `Your Company Name <security@thisdata.com>`. Your name and logo are also displayed in the email. These settings are all found, and can be customized, within the ThisData app. These settings will apply to all events by default. # How do I customize individual notifications? For multi-tenanted applications, you need to send customization details with _every_ event you want to customize. You must *always* pass a non-blank name for those customized events. For example, let's say your ThisData account is called "DemoCo". When a user is interacting with Tenant X, send details about Tenant X in the event payload. If they are interacting with Tenant Y, send details about Tenant Y. The [Events API](doc:apiv1events) has details on the `source` attribute you must use to achieve this customization. [block:callout] { "type": "success", "title": "You'll need to be Golden!", "body": "Per-event customization / multi-tenanting is available on all our Gold plans and above." } [/block] # Example If an event looks unusual and triggers a _"Was this you?" email, we will look at the details in that event payload. ## Without sending tenant information: ``` curl -XPOST 'https://api.thisdata.com/v1/events.json?api_key=abc123' -d '{ "ip" : "130.216.39.241", "verb" : "log-in", "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36", "user" : { "id" : "112233", "name" : "Logan Brown", "email" : "logan.brown@example.com", "mobile" : "+64270000001" } }' ``` > _Did you just log in to DemoCo from San Francisco, CA?_ ## With Tenant Information ``` curl -XPOST 'https://api.thisdata.com/v1/events.json?api_key=abc123' -d '{ "ip" : "130.216.39.241", "verb" : "log-in", "user_agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36", "user" : { "id" : "112233", "name" : "Logan Brown", "email" : "logan.brown@example.com", "mobile" : "+64270000001" }, "source" : { "name" : "Tenant Y", "logo_url" : "https://tenanty.democo.com/logo.png" } }' ``` > _Did you log in to Tenant Y from San Francisco, CA?_ # What can I customize? ### Name Use `source[name]` to customize the name shown in the Was This You notifications. This applies to both email and SMS where applicable. ### Logo in the Was This You? email Use `source[logo_url]` to customize the logo shown in the top right of the Was This You? notification. (SMS messages do not contain an image.) **Currently you must also pass a non-blank `source["name"]` for us to use the `logo_url`.** # What happens if I don't pass a Name or Logo URL? If you pass a null or blank `name`, we will not do anything with the multi-tenant source information. Any notifications will look like normal - using your account name and, if you uploaded one in the API Settings page, the logo image in the Was This You emails. If you pass a custom name, and no `logo_url`, we will use the custom name in Email and SMS notifications. In the Email we will use the default logo you have uploaded in the API Settings, if you uploaded one. If you pass a null or blank `name`, and *do* pass a `logo_url`, we currently won't use that logo. # How do I get access to per-event customization / multi-tenanting? Per-event customization / multi-tenanting is available on all our Gold plans and above. It can require a small amount of work to properly configure, so [contact us now](mailto:sales@thisdata.com) to begin the process.