Expose a template's format to view engines so they can render a Markdown mail's text version

Open
#866 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ruttydm is already working on this.

Since Dec 4, 2026.

  • #881 by @ruttydm — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
rust
Domain
backend

Research direction

Start with Template::format() and the Format type, which the issue says are currently restricted in visibility. Read the built-in Markdown mail rendering path to see how it uses Format::TextVersion, then compare it with the third-party Engine example. Done when an external engine can inspect the template format and render a Markdown mail's text version; pull request #881 is already open for this issue.

Written by the indexing model from the issue text.

Description

For Markdown mail, the framework renders a message's text body with Format::TextVersion, and the mail components use simpler markup in that mode. A third-party Engine can't see the mode:

impl Engine for MyEngine {
    fn render(&self, template: &Template<'_>) -> laravel::Result<String> {
        let format = template.format();
        // error[E0599]: method `format` is private
        // template.is_plain_text() is false for TextVersion
        todo!()
    }
}

Format is re-exported but #[doc(hidden)], and Template::format() is pub(crate). Making Template::format() public (and Format a documented type) would let other engines render the text version of Markdown mail as the built-in one does.

Context: found while porting Laravel's mail Markdown components to a Blade engine for Laravel for Rust (oxblade).

Dominant language
Rust
Stars
847
Forks
174
Avg merge
5h 40m
Merged PRs (30d)
167

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from laravel/rust-framework

All issues in laravel/rust-framework

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.