{"_id":"542ae00fcedcfc140004b81e","version":{"_id":"542979c51215fe08007e0ee8","project":"542979c51215fe08007e0ee5","__v":4,"createdAt":"2014-09-29T15:24:53.437Z","releaseDate":"2014-09-29T15:24:53.437Z","categories":["542979c51215fe08007e0ee9","542985897a6b690800767fab","5429898d1215fe08007e0fe6","542ac5aa54d88d140075fcaf"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"542979c51215fe08007e0ee9","project":"542979c51215fe08007e0ee5","version":"542979c51215fe08007e0ee8","__v":12,"pages":["542979c51215fe08007e0eeb","542ae00fcedcfc140004b81e","542abdb354d88d140075fbf2","542986467a6b690800767fb1","54298c241215fe08007e0ff4","54380adef1c23914006724b9","546287c18ba5620800710e4c","55e99381358d923700be988e","56328926df556c0d00cd0929","56421475b0dc090d00f8842c"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-29T15:24:53.471Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"is_link":false,"parentDoc":null,"project":"542979c51215fe08007e0ee5","__v":6,"user":"542979b61215fe08007e0ee4","updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-09-30T16:53:35.047Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":1,"body":"Inkcite ships with three distinct environments - `development`, `preview` and `production`.  These environments reflect what we believe is the most common email production workflow:\n\n1. develop the email and artwork locally \n2. send preview versions (optionally minified with image cache-busting enabled, etc.) to yourself, copy editors and/or clients for proofing.\n3. build a production version (optimized, minified, tracked and tagged) ready to be loaded into your ESP and send to your recipients.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Note!\",\n  \"body\": \"Inkcite does not replace an email service like [Campaign Monitor](https://www.campaignmonitor.com) and [Mail Chimp](http://mailchimp.com/). Inkcite helps you build the assets necessary to send modern, responsive emails using a separate mail delivery service or tool.\"\n}\n[/block]\nIn general, Inkcite chooses the right environment for your current task but you can override using `--environment (environment)` or the shorthand `-e (environment)` parameter.  For example, to see the production version of your email in your browser, you could run this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"inkcite server -e production\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nYou can easily make environment-specific configuration changes in `config.yml`.  For example, to enable image `cache-bust` by default but disable it for production builds (recommended) you can modify Inkcite's configuration in this way:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Enable image cache-busting by default.\\ncache-bust: true\\n\\n# Override the default configuration for production builds.\\nproduction:\\n  cache-bust: false\",\n      \"language\": \"ruby\",\n      \"name\": \"config.yml\"\n    }\n  ]\n}\n[/block]\n# Development\n\nIn the `development` environment, your email is served directly from your local workstation.  Images are loaded from your project's local `images/` subdirectory.  This is the default environment when you start `inkcite server` and the changes you make inside of your project are immediately visible when you refresh your browser.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Enable minification of HTML and CSS by default\\nminify: true\\n\\n# Disable minification during local development so it's easy\\n# to inspect the rendered page's souce code if necessary.\\ndevelopment:\\n  minify: false\",\n      \"language\": \"ruby\",\n      \"name\": \"config.yml\"\n    }\n  ]\n}\n[/block]\n# Preview\n\nIn the `preview` environment, Inkcite generates an email intended for an internal or private audience of reviewers.  Images are uploaded to a web-accessible server of your choosing and in the HTML it generates, Inkcite uses fully-qualified image URLs.\n\nThis is the default environment when you run `inkcite preview`.  To learn more, refer to [Email Previews](doc:email-previews).\n\n# Production\n\nThe `production` environment is used when Inkcite is preparing your final, ready-to-go assets.  \n\n* Images are uploaded to your CDN and fully-qualified URLs are injected into your HTML.\n* Link tracking and tagging is applied, if desired\n* Your HTML is minified\n* Failsafe checks are executed to save you from costly errors\n\nInkcite will not production production-ready files unless all warnings and errors are addressed.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!-- Add Litmus analytics tracking only in the production mode -->\\n<% if production? %>\\n  {litmus id='12345'}\\n<% end %>\",\n      \"language\": \"html\",\n      \"name\": \"email.html\"\n    }\n  ]\n}\n[/block]","excerpt":"Introduction to development, preview and production builds","slug":"environments","type":"basic","title":"Environments"}

Environments

Introduction to development, preview and production builds

Inkcite ships with three distinct environments - `development`, `preview` and `production`. These environments reflect what we believe is the most common email production workflow: 1. develop the email and artwork locally 2. send preview versions (optionally minified with image cache-busting enabled, etc.) to yourself, copy editors and/or clients for proofing. 3. build a production version (optimized, minified, tracked and tagged) ready to be loaded into your ESP and send to your recipients. [block:callout] { "type": "warning", "title": "Note!", "body": "Inkcite does not replace an email service like [Campaign Monitor](https://www.campaignmonitor.com) and [Mail Chimp](http://mailchimp.com/). Inkcite helps you build the assets necessary to send modern, responsive emails using a separate mail delivery service or tool." } [/block] In general, Inkcite chooses the right environment for your current task but you can override using `--environment (environment)` or the shorthand `-e (environment)` parameter. For example, to see the production version of your email in your browser, you could run this: [block:code] { "codes": [ { "code": "inkcite server -e production", "language": "shell" } ] } [/block] You can easily make environment-specific configuration changes in `config.yml`. For example, to enable image `cache-bust` by default but disable it for production builds (recommended) you can modify Inkcite's configuration in this way: [block:code] { "codes": [ { "code": "# Enable image cache-busting by default.\ncache-bust: true\n\n# Override the default configuration for production builds.\nproduction:\n cache-bust: false", "language": "ruby", "name": "config.yml" } ] } [/block] # Development In the `development` environment, your email is served directly from your local workstation. Images are loaded from your project's local `images/` subdirectory. This is the default environment when you start `inkcite server` and the changes you make inside of your project are immediately visible when you refresh your browser. [block:code] { "codes": [ { "code": "# Enable minification of HTML and CSS by default\nminify: true\n\n# Disable minification during local development so it's easy\n# to inspect the rendered page's souce code if necessary.\ndevelopment:\n minify: false", "language": "ruby", "name": "config.yml" } ] } [/block] # Preview In the `preview` environment, Inkcite generates an email intended for an internal or private audience of reviewers. Images are uploaded to a web-accessible server of your choosing and in the HTML it generates, Inkcite uses fully-qualified image URLs. This is the default environment when you run `inkcite preview`. To learn more, refer to [Email Previews](doc:email-previews). # Production The `production` environment is used when Inkcite is preparing your final, ready-to-go assets. * Images are uploaded to your CDN and fully-qualified URLs are injected into your HTML. * Link tracking and tagging is applied, if desired * Your HTML is minified * Failsafe checks are executed to save you from costly errors Inkcite will not production production-ready files unless all warnings and errors are addressed. [block:code] { "codes": [ { "code": "<!-- Add Litmus analytics tracking only in the production mode -->\n<% if production? %>\n {litmus id='12345'}\n<% end %>", "language": "html", "name": "email.html" } ] } [/block]