Skip to content

fix: [#941] separate raw mail text from views - #1491

Merged
hwbrzzl merged 2 commits into
masterfrom
fix-941-mailable-raw-text-content
Jun 13, 2026
Merged

fix: [#941] separate raw mail text from views#1491
hwbrzzl merged 2 commits into
masterfrom
fix-941-mailable-raw-text-content

Conversation

@goravel-coder

Copy link
Copy Markdown
Contributor

Summary

  • Treat mail.Content.Text as raw plain-text email body content.
  • Rename the HTML template field to HtmlView and add TextView for plain-text templates.
  • Render HtmlView and TextView into their matching email body parts.

Closes goravel/goravel#941

Why

mail.Content.Text previously behaved like a template path, so sending raw text such as "Hello" attempted to render a template named Hello. The content API now separates raw bodies from template views, so plain text can be sent directly while template users have explicit HTML and text view fields.

func (m *WelcomeMail) Content() *mail.Content {
	return &mail.Content{
		Html: "<h1>Hello Goravel</h1>",
		Text: "Hello Goravel",
	}
}

Applications that render templates should use HtmlView and TextView, which makes multipart email behavior explicit and avoids overloading Text with two meanings.

@goravel-coder
goravel-coder requested a review from a team as a code owner June 13, 2026 08:11
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.46%. Comparing base (af5e263) to head (97ed1ae).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1491      +/-   ##
==========================================
- Coverage   69.46%   69.46%   -0.01%     
==========================================
  Files         378      378              
  Lines       29710    29713       +3     
==========================================
+ Hits        20639    20640       +1     
- Misses       8118     8119       +1     
- Partials      953      954       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl
hwbrzzl merged commit b1329d3 into master Jun 13, 2026
20 checks passed
@hwbrzzl
hwbrzzl deleted the fix-941-mailable-raw-text-content branch June 13, 2026 08:40
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.

Can't set raw text content for Mailable

2 participants