theme: Next, 0 build-lists: true
##simple, logical, customer-editable templates for pages and emails
- HTML gives customers too much control, they make a mess and can create security risks eg. script tags
- Customer editable templates need {{merge fields}} and perhaps some basic logic eg. if/then & loops but we can't let them insert arbitrary code (so no erb)
- Editable templates means templates in the database, but sometimes you also want them in the file system too
- We want to do all this for pages and emails (rendered the same in Rails by ActionView)
- We want to generate the text and html parts of an email with a single template
- We want a html layout for inserting css, javascript, header tags etc for a non-html template despite Rails restriction on this
-
liquid gem for {{templating}}
-
kramdown gem for **markdown**
-
panoramic gem for database templates
- Developed by Shopify.com, one of the oldest and most successful Rails sites
- We can trust them for keeping customers from executing arbitray code on the server
- merge fields, loops, conditionals, filters eg. strip_html_tags
- Works with any text
- HTML class support for styling
- Tables
- PlainText converter (markdown can look a bit funky)
- "probably the fastest pure-Ruby Markdown converter available"
- Implemented using Rails ActionView::Resolver
- Can still use file-based templates eg. for development
- Supports both database-first and file-first when loading
- An optional integration, not a hard dependency
- text and html parts of an email from a single template
- raw markdown is almost good enough for the text part (we use Kramdown's PlainText converter to clean it up)
- HTML part is rendered from Markdown
- Unlike other markdown email gems, we support HTML layouts
- Works with Zurb Foundation for Emails (formerly Ink)
... for Detail on Rails ActionView::Resolver
This presentation was written in markdown and is in the github repo above. It was rendered and played by Deskset for Mac.