The shared-work-package email built its "Open work package" link and its
text-part heading from the numeric primary key, so recipients on a
semantic-identifier instance still landed on /work_packages/<numeric-id>
rather than the semantic URL.
Pass the work package itself to the URL helper so to_param yields the
display id, and render the text heading with formatted_id to match the
other work package mailers. Also drops an unused @notification_url that
carried the same numeric-id problem.
STC-747
`format_text` accepts `render_mode:` (`:in_app_html`, `:external_html`,
`:external_text`), which resolves the `only_path`, `static_html` and
`plain_text` context flags as a set. External surfaces (mailer HTML
body, future RSS/PDF/webhook) need absolute URLs and static rendering
together; pinning the trio at the public API keeps callers from
forgetting one. Explicit primitive kwargs still override.
`MailFormattingHelper` exposes `format_mail_html` and `format_mail_text`
thin wrappers around `format_text(render_mode:)`. The `_html` / `_text`
suffix matches the `.html.erb` / `.text.erb` template extension so
caller intent stays visible in the view, with no introspection of
`formats`.
The five WorkPackageMailer view sites use the helpers; `_work_package_details`,
`mentioned.html`, `mentioned.text`, `watcher_changed.html`, `watcher_changed.text`
drop the `static_html:`/`only_path:`/`plain_text:` boilerplate.
* Escape sharing info in mail correctly
* Localize the shared permissions in the mail
* Replace custom method with builtin `to_sentence`
* Restructure sentence and use verbs explicitly for better wording in other languages
It was setting ActionMailer::Base.perform_deliveries for the duration of
the block, but perform_deliveries is a class attribute, so not thread
local and doesn't work as expected in combination with setting
perform_deliveries to true when calling
Setting::MailSettings#reload_mailer_settings! at the start of every
request and every job run
https://community.openproject.org/work_packages/60342
Reminder email template will be redesigned to differentiate from notifications. In the meantime,
we add the note or work package subject in the email subject as a tiny enhancements.