Skip to main content

Crate ferrum_email_render

Crate ferrum_email_render 

Source
Expand description

§ferrum-email-render

The rendering engine for Ferrum Email.

This crate takes Component implementations, calls their render() methods to produce Node trees, and converts those trees into:

  • HTML — email-safe HTML with all CSS inlined as style="" attributes
  • Plain text — extracted from text nodes with sensible formatting

§Rendering Pipeline

Component::render() → Node tree
       ↓
   CSS Inliner       (all styles → inline style="" attrs)
       ↓
   HTML Emitter      (produces final HTML string)
       ↓
   Text Extractor    (produces plain text fallback)

§Usage

use ferrum_email_render::Renderer;
use ferrum_email_core::Component;

let renderer = Renderer::default();
let email = MyEmail;
let html = renderer.render_html(&email).unwrap();
let text = renderer.render_text(&email).unwrap();

Re-exports§

pub use renderer::RenderConfig;
pub use renderer::Renderer;

Modules§

css_inliner
CSS inlining for email-safe rendering.
html_emitter
HTML string building utilities — entity escaping and tag emission.
renderer
The core renderer — walks a Node tree and emits email-safe HTML.
text_extractor
Plain text extraction from a Node tree.

Enums§

RenderError
Errors that can occur during rendering.