Skip to content

Fix gen:mail --markdown type error and accept HtmlString content in Mailer - #4

Merged
huangdijia merged 2 commits into
mainfrom
copilot/fix-generate-markdown-command-error
Sep 12, 2026
Merged

Fix gen:mail --markdown type error and accept HtmlString content in Mailer#4
huangdijia merged 2 commits into
mainfrom
copilot/fix-generate-markdown-command-error

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

gen:mail --markdown could return a boolean from getView() and crash during template path generation. Separately, Content(htmlString: ...) flowed into Mailer::addContent() as HtmlString and failed strict parameter typing.

  • Markdown mail generator correctness

    • Corrected stub selection for --markdown so markdown generation uses markdown-mail.stub.
    • Updated getView() to always derive a string view name when the option is a boolean flag.
    • Aligned buildClass() markdown branch check with flag semantics.
  • HtmlString support through mail rendering pipeline

    • Expanded Mailer type signatures in parseView(), addContent(), and renderView() to accept HtmlString / Htmlable.
    • Preserved existing rendering behavior while allowing pre-rendered HTML payloads from Content(htmlString: ...).

Example (now accepted without type error):

public function content(): Content
{
    return new Content(
        htmlString: '<h1>Hello</h1><p>Mail body</p>',
    );
}

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: cec74159-d4c4-4315-9117-16c8e5fec740

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: huangdijia <8337659+huangdijia@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix markdown command generation error and htmlString issue Fix gen:mail --markdown type error and accept HtmlString content in Mailer Sep 11, 2026
Copilot AI requested a review from huangdijia September 11, 2026 13:53
@huangdijia
huangdijia marked this pull request as ready for review September 12, 2026 08:10
@huangdijia
huangdijia merged commit bc8f969 into main Sep 12, 2026
1 check passed
@huangdijia
huangdijia deleted the copilot/fix-generate-markdown-command-error branch September 12, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【BUG】生成markdown命令出错,另外也不支持htmlString

2 participants