Migrate remaining mailers to format_mail_html / format_mail_text - #23387
Merged
Conversation
3 tasks
oliverguenther
approved these changes
May 28, 2026
oliverguenther
left a comment
Member
There was a problem hiding this comment.
Thanks for the extra mile @akabiru 👍
The view-helper migration introduced by the parent PR now covers the remaining mailer surfaces: UserMailer (`message_posted`, `news_added`, `news_comment_added`), ProjectMailer (`project_created`), ProjectArtifactsMailer (`creation_wizard_submitted`), MemberMailer (`added_project`, `updated_project`, `updated_global`), AnnouncementMailer (`announce`), DocumentsMailer (`document_added`), and the shared mailer layout (`localized_emails_header`, `localized_emails_footer`). Sites drop the `static_html: true` / `only_path: false` / `plain_text: true` boilerplate; `render_mode:` pinning lives in the helper. The layout previously called `OpenProject::TextFormatting::Renderer.format_text` directly, bypassing the helper layer. The empty visibility cache (no current_user-scoped preload at layout time) is handled by the existing fallback in `LinkHandlers::WorkPackages#text_only?` — covered by a new sanity spec in `user_mailer_spec.rb` that exercises the header path with a WP reference and asserts plain-text formatted_id rendering. Per-bucket regression coverage added: absolute-URL and formatted_id assertions across both classic and semantic identifier modes, mirroring the WorkPackageMailer spec pattern.
akabiru
force-pushed
the
refactor/migrate-remaining-mailers-to-render-mode
branch
from
May 28, 2026 09:07
89e2d01 to
ec2a025
Compare
akabiru
marked this pull request as ready for review
May 28, 2026 09:07
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
https://community.openproject.org/wp/75389
Follow-up to #23337. Stacked on that PR — the diff will collapse once #23337 lands in
dev.Note
Related: opf/rubocop-openproject#5 introduces
OpenProject/UseRenderModeInsteadOfPrimitives, which flags the pre-migration shape (static_html: true/plain_text: true/only_path: falseonformat_text).What are you trying to accomplish?
Mailer views still carry the
static_html: true/only_path: false/plain_text: trueboilerplate on everyformat_textcall. This PR routes the remaining sites throughformat_mail_html/format_mail_textsorender_mode:is pinned once at the helper layer.Migrated surfaces:
message_posted,news_added,news_comment_addedproject_createdcreation_wizard_submittedadded_project,updated_project,updated_globalannounce(body, header, subheader)document_addedlocalized_emails_header,localized_emails_footer(previously calledOpenProject::TextFormatting::Renderer.format_textdirectly, bypassing the helper)Merge checklist