39 Commits

Author SHA1 Message Date
Kabiru Mwenja 0d3c2850c9 Resolve notification email links to the semantic identifier too
The notification-row partial and the mention email's "see in center"
button built their /notifications/details/<id> links from the numeric
primary key, so mention, digest and reminder emails still linked to the
numeric URL on a semantic-identifier instance.

The split view already resolves the id through find_by_display_id, which
accepts both the numeric id and the semantic identifier, so handing it
the work package lets to_param render the display id. Also drops the
unused split_view_work_package_id helper, whose to_i wrongly suggested
the route only accepts a numeric id.
2026-06-02 10:18:30 +03:00
Kabiru Mwenja 499d7820a2 Add render_mode flag and MailFormattingHelper
`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.
2026-05-27 13:04:26 +03:00
Kabiru Mwenja f5957d800f Collapse plain-text formatter into a context option
Same pattern as the static-HTML collapse: the `markdown_as_text` format
symbol was a thin subclass setting a context flag and swapping the filter
list. Replace it with `plain_text: true` on the existing rich formatter,
which now picks between `RICH_FILTERS` and `TEXT_FILTERS` constants based
on the flag. `static_html:` and `plain_text:` now sit as peer options on
one format.

Rename the `as_text` context key to `plain_text` for symmetry with
`static_html`. Update both mailer `.text.erb` views and the two handler
predicates that branch on the flag.
2026-05-26 22:10:29 +03:00
Kabiru Mwenja 776536d88b Drop redundant explicit format: :rich
`:rich` is the default at every layer of the `format_text` chain
(view helper → `OpenProject::TextFormatting#format_text` →
`Renderer.format_text`), so the explicit keyword adds noise.
2026-05-26 14:56:03 +03:00
Kabiru Mwenja 94c13c11fa Collapse static-HTML formatter into a context option
The static-HTML pipeline differs from the rich pipeline only by a
context flag - both share the same filter chain. The dedicated
`Markdown::StaticHtmlFormatter` and `:markdown_as_static_html`
format symbol were pure boilerplate around that one-line override.

Callers now pass `format: :rich, static_html: true` and the matchers
read `context[:static_html]` directly.
2026-05-26 14:50:59 +03:00
Kabiru Mwenja ee4c9aee59 Render WP quickinfo macros as static HTML in mailer notes
The `##N` and `###N` work-package macros emit JS-hydrated
`<opce-macro-wp-quickinfo>` custom elements, which mail clients
collapse to empty bullets. Introduce a `:markdown_as_static_html`
format that shares the rich filter chain but signals
`context[:as_static_html]` so the matcher and `MentionFilter` emit a
server-rendered anchor — formatted_id, type name, subject, and (for
`###`) status name — closely mirroring the in-app widget once
flattened.

Mailer HTML templates (`mentioned`, `watcher_changed`,
`_work_package_details`) opt into the new format. Invisible WPs still
render as plain-text labels, matching the cross-project visibility
policy.

`ResourceLinksMatcher.build_cache` and
`MentionFilter#preload_work_package_mentions` eager-load `:type` and
`:status` only when `:as_static_html` is set, leaving the default web
path's two-SELECT shape untouched. Classic-mode preload now also runs
under `:as_static_html` so the link handler can resolve type/subject
for `##`/`###`.

Renames the internal flag `context[:plain_text]` to `context[:as_text]`
to restore symmetry with the user-facing `:markdown_as_text` format.
2026-05-26 14:19:23 +03:00
Kabiru Mwenja a54dd3dc0b Rename :plain_text format to :markdown_as_text
The format runs the full markdown pipeline and then collapses the DOM
to text — it has nothing to do with the existing `:plain` format,
which strips markdown entirely. Moves the formatter under the Markdown
namespace next to the rich-output formatter whose pipeline it mirrors,
and renames the symbol so the relationship is legible from the
formatter_for case clause.
2026-05-26 14:19:11 +03:00
Kabiru Mwenja 7c9d15e506 Render WP identifiers per current mode in plain-text mailer notes
The `mentioned` and `watcher_changed` text-mailer bodies surfaced raw
journal markdown — numeric `#42` references stayed numeric in semantic
mode, and `<mention>` envelopes leaked as HTML source.

Introduces `:plain_text` as a sibling format inside the existing Plain
module. The filter chain mirrors the markdown pipeline (markdown,
sanitization, mention, pattern-matcher) and finishes with a new
`PlainTextOutputFilter` that collapses the DOM to text. The
`WorkPackages` link handler and `MentionFilter` get plain-text branches
keyed off `context[:plain_text]` so identifier resolution stays in one
place across rich and plain channels.

Closes https://community.openproject.org/wp/74762
2026-05-26 14:18:17 +03:00
Judith Roth 2efc96504a [#73827] Adapt email notifications for project-based work package identifiers
https://community.openproject.org/wp/73827
2026-05-05 10:47:39 +02:00
Henriette Darge deeb026431 Adapt tests to new reminders and notifications structure 2026-03-30 11:56:23 +02:00
Alexander Brandon Coles 1ee3bb1859 DRY up #format_text calls, using most apt overload 2025-05-27 11:03:09 +01:00
Ivan Kuchin ca5f8fb878 erb_lint auto fix trailing commas 2025-02-11 18:49:21 +01:00
Ivan Kuchin a98789d986 erb_lint auto fix part of style 2/3 2025-02-11 18:49:21 +01:00
Ivan Kuchin fba9d4b506 erb_lint auto fix quoted symbol 2025-02-11 18:49:21 +01:00
Ivan Kuchin 0f6a12da3a erb_lint auto fix layout 2025-02-11 18:49:20 +01:00
Ivan Kuchin fb715f21b9 erb_lint auto fix quotes 2025-02-11 18:49:19 +01:00
Ivan Kuchin 0b1f73ec79 erb_lint auto except rubocop linter 2025-02-11 18:49:19 +01:00
Henriette Darge 405789729a Redirect to Activity tab in the notification emails (like it was before the refactoring of the notification center) 2024-09-09 07:26:23 +02:00
Oliver Günther 12ee9e6b83 Merge remote-tracking branch 'origin/idea/56781-remove-years-from-copyrights' into dev 2024-08-06 10:17:59 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Oliver Günther f9aa46d87f Remove center page and toolbar 2024-07-26 10:32:07 +02:00
Christophe Bliard 3d4067ad12 Remove behavior tied to disabled done_ratio field
Disabled mode does not exist anymore since acbace64e7.

For changes in translation files, some validation messages were removed
in dcd2a3b03c.
2024-04-15 17:20:52 +02:00
Andreas Pfohl d9ac8d0ca8 Added mail template for healthy storage notification 2024-03-01 09:27:37 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Oliver Günther feb3edff13 Store salutation as setting to make it reusable 2023-11-02 19:41:35 +01:00
Oliver Günther c5c52d7959 Implement previewable scheduled meeting mailer based on common layout 2023-10-31 16:19:41 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Oliver Günther ed8a0df4f7 Allow provided salutation in announcement 2022-08-10 15:22:01 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
ulferts aace67b63e send 12.0 update mail 2021-11-05 16:31:57 +01:00
Henriette Darge 5cc6ab0f4d Remove obsolete tests. As we don't show details any more, we don't need to test for it. 2021-10-20 10:59:50 +02:00
Henriette Darge e833a399aa Align email header with left hand border of the notification box 2021-10-19 12:51:29 +01:00
Henriette Darge 9ac05a293b Show correct button with individual link in each email 2021-10-19 12:51:20 +01:00
Henriette Darge 116f57acbd Increase space between last button and footer in emails 2021-10-05 09:06:36 +02:00
Henriette Darge 75850681be Allow styles of comment in the mail 2021-10-04 14:27:46 +02:00
Henriette Darge 60c185b629 Show correct reason for mentioned mail and some minor changes in the text display 2021-09-30 14:05:56 +02:00
Henriette Darge dfbd0f8ef0 Add content for mentioned mail 2021-09-30 13:38:20 +02:00
ulferts 672a5c79b6 consolidate work package mailing 2021-09-30 12:59:26 +02:00
ulferts 8aca19d827 sending empty mail on mentioning 2021-09-30 12:59:26 +02:00