{"_id":"54380adef1c23914006724b9","parentDoc":null,"__v":2,"is_link":false,"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"},"project":"542979c51215fe08007e0ee5","user":"542979b61215fe08007e0ee4","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-10T16:35:42.278Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"try":true,"basic_auth":false,"auth":"never","params":[],"url":""},"isReference":false,"order":8,"body":"Inkcite's Failsafes ensure your email includes everything you want and nothing you don't. Out of the box, Inkcite automatically warns you if your current project meets any of these conditions:\n\n* Uses the [Lorem Ipsum](doc:lorem-ipsum) helper\n* Has placeholder or [Images](doc:image) that are missing dimensions\n* Has links that are missing \n\nInkcite also supports custom Failsafes.  These allow you to verify that your email either includes or excludes specific content.\n\nFor example, let's say your company's authorized resellers were formerly called \"dealers\", but now must always be referred to as \"retailers\" instead.  Additionally, every email you create must include a link allowing the recipient to find a local retailer.  These are the sort of requirements that Failsafes were made for.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Make sure no one uses the word 'dealer' in their email content.\\n# And ensure every email includes a link to the company's retailer\\n# search page.\\nfailsafes:\\n  excludes:\\n    - \\\"dealer\\\"\\n  includes:\\n    - '<a href=\\\"http://company.com/find-a-retailer/\\\">'\",\n      \"language\": \"ruby\",\n      \"name\": \"config.yml\"\n    }\n  ]\n}\n[/block]\nWhen a Failsafe is triggered, Inkcite will warn you in its command line output:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ inkcite build\\nThe prospects version (email) has 1 errors:\\n- Failsafe! Email must not include \\\"dealer\\\" (line 362)\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nYou can specify as many Failsafes as necessary, and they can be defined globally and/or by environment.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Make sure production emails always include an \\n# unsubscribe link and a Litmus analytics tracking\\n# code.\\nproduction:\\n  failsafes:\\n    includes:\\n      - Unsubscribe\\n      - '<a href=\\\"http://company.com/unsubscribe.asp\\\">'\\n      - /https://[^\\\\.]+.emltrk.com/\",\n      \"language\": \"ruby\",\n      \"name\": \"config.yml\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Advanced Feature\",\n  \"body\": \"You can use regular expressions for explicit matching control.  Start and end your regex Failsafe with `/`.\"\n}\n[/block]\nViewing your email locally and sending preview versions still work when Inkcite detects problems in your email, but you can't build the production assets unless you force Inkcite to do it (*not recommended*).\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"inkcite build --force\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","excerpt":"Take some of the fear out of pressing the Send! button","slug":"failsafes","type":"basic","title":"Failsafe Rules"}

Failsafe Rules

Take some of the fear out of pressing the Send! button

Inkcite's Failsafes ensure your email includes everything you want and nothing you don't. Out of the box, Inkcite automatically warns you if your current project meets any of these conditions: * Uses the [Lorem Ipsum](doc:lorem-ipsum) helper * Has placeholder or [Images](doc:image) that are missing dimensions * Has links that are missing Inkcite also supports custom Failsafes. These allow you to verify that your email either includes or excludes specific content. For example, let's say your company's authorized resellers were formerly called "dealers", but now must always be referred to as "retailers" instead. Additionally, every email you create must include a link allowing the recipient to find a local retailer. These are the sort of requirements that Failsafes were made for. [block:code] { "codes": [ { "code": "# Make sure no one uses the word 'dealer' in their email content.\n# And ensure every email includes a link to the company's retailer\n# search page.\nfailsafes:\n excludes:\n - \"dealer\"\n includes:\n - '<a href=\"http://company.com/find-a-retailer/\">'", "language": "ruby", "name": "config.yml" } ] } [/block] When a Failsafe is triggered, Inkcite will warn you in its command line output: [block:code] { "codes": [ { "code": "$ inkcite build\nThe prospects version (email) has 1 errors:\n- Failsafe! Email must not include \"dealer\" (line 362)", "language": "shell" } ] } [/block] You can specify as many Failsafes as necessary, and they can be defined globally and/or by environment. [block:code] { "codes": [ { "code": "# Make sure production emails always include an \n# unsubscribe link and a Litmus analytics tracking\n# code.\nproduction:\n failsafes:\n includes:\n - Unsubscribe\n - '<a href=\"http://company.com/unsubscribe.asp\">'\n - /https://[^\\.]+.emltrk.com/", "language": "ruby", "name": "config.yml" } ] } [/block] [block:callout] { "type": "info", "title": "Advanced Feature", "body": "You can use regular expressions for explicit matching control. Start and end your regex Failsafe with `/`." } [/block] Viewing your email locally and sending preview versions still work when Inkcite detects problems in your email, but you can't build the production assets unless you force Inkcite to do it (*not recommended*). [block:code] { "codes": [ { "code": "inkcite build --force", "language": "shell" } ] } [/block]