Roadie

screenshot of Roadie

Making HTML emails comfortable for the Ruby rockstars

Overview

Roadie is a gem that aims to simplify the process of sending HTML emails for Ruby developers by inlining stylesheets and rewriting relative URLs. Many email clients struggle with external styles, making it necessary to use inline styles. Roadie takes on the heavy lifting, automatically inlining styles from your CSS into the document while maintaining the order of selectors just like a browser would. This helps eliminate the usual headaches and ensures your HTML emails look great, regardless of the email client usage.

Despite being in passive maintenance mode, Roadie continues to provide valuable functionality for developers of all levels, making it a worthwhile tool for anyone looking to enhance their email-sending workflow.

Features

  • CSS Styles Inlining: Automatically inlines CSS styles into the HTML document to ensure compatibility with various email clients.
  • Respect for !important: Maintains the specificities of styles designated with !important, ensuring they are applied as intended.
  • Support for CSS Selectors: Utilizes CSS selectors recognized by Nokogiri, allowing for more advanced styling techniques like CSS3 selectors.
  • Preservation of Dynamic Selectors: Keeps dynamic selectors such as :hover and @media in a separate element for clients that support them.
  • Absolute URLs: Converts all relative URLs in images and stylesheets to absolute URLs, preventing display issues in emails.
  • Configurable Hostname: Allows customization of hostname and port on a per-environment basis, making deployment easier.
  • Selective Ignoring: Offers the ability to disable inlining on specific elements using a data-roadie-ignore attribute.
  • Automatic HTML Skeleton Creation: Adds a proper HTML skeleton when missing, removing the need to build a layout from scratch for emails.