Skip to content

Document the live preview in the web Notification editor - #932

Open
promptless-for-oss wants to merge 4 commits into
mautic:7.2from
Promptless:promptless/pr-16928-notification-live-preview
Open

promptless-for-oss wants to merge 4 commits into
mautic:7.2from
Promptless:promptless/pr-16928-notification-live-preview

Conversation

@promptless-for-oss

@promptless-for-oss promptless-for-oss commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Open in Promptless

The web Notification editor now updates its preview panel in real time as you type. This adds an "Editing a Notification" subsection to the Web notifications page describing how the Heading, Message, and Action Button Text fields update the preview as you enter text — so you can see how a Notification will look without saving and reopening it — and how the preview behaves when those fields are empty (Heading and Message revert to their default text; an empty Action Button Text hides the action button). The page previously covered only OneSignal setup and sending, with no description of the notification content editor.

Trigger Events

Add an 'Editing a Notification' subsection to web_notifications.rst
describing how the editor's preview panel updates as you type the
Heading, Message, and Action Button Text fields, and how empty fields
behave in the preview (mautic/mautic#16928).

Editing a Notification
======================
When you open or create a Notification under Web Notifications, the editor shows a live preview panel beside the **Heading**, **Message**, and **Action Button Text** fields. As you enter text in them, Mautic updates the matching elements in the preview, so you can see how the Notification looks without saving and reopening it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mautic.activatePreviewPanelUpdate() binds an input handler to the heading/message/button fields and writes each typed value into the matching preview element live, confirming the live-update behavior described.

Source: https://github.com/mautic/mautic/blob/c7cc81c3a967c6dc5fc69e37eef265d11d5297ef/app/bundles/NotificationBundle/Assets/js/notification.js#L62-L86

======================
When you open or create a Notification under Web Notifications, the editor shows a live preview panel beside the **Heading**, **Message**, and **Action Button Text** fields. As you enter text in them, Mautic updates the matching elements in the preview, so you can see how the Notification looks without saving and reopening it.

When a field is empty, the preview shows default text instead. An empty **Heading** shows 'Notification' and an empty **Message** shows 'You have a new message'. When **Action Button Text** is empty, the action button doesn't appear in the preview.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preview.html.twig defaults heading/message to translated placeholders (mautic.notification.preview.notification / .message) when empty, and toggles a hide class on the button preview element when notification.button is empty, confirming the empty-field defaulting and action-button-hidden behavior.

Source: https://github.com/mautic/mautic/blob/c7cc81c3a967c6dc5fc69e37eef265d11d5297ef/app/bundles/NotificationBundle/Resources/views/Notification/preview.html.twig#L17-L22

======================
When you open or create a Notification under Web Notifications, the editor shows a live preview panel beside the **Heading**, **Message**, and **Action Button Text** fields. As you enter text in them, Mautic updates the matching elements in the preview, so you can see how the Notification looks without saving and reopening it.

When a field is empty, the preview shows default text instead. An empty **Heading** shows 'Notification' and an empty **Message** shows 'You have a new message'. When **Action Button Text** is empty, the action button doesn't appear in the preview.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translation strings mautic.notification.preview.notification="Notification" and mautic.notification.preview.message="You have a new message" are the exact default placeholder text shown in the preview when Heading/Message are empty.

Source: https://github.com/mautic/mautic/blob/c7cc81c3a967c6dc5fc69e37eef265d11d5297ef/app/bundles/NotificationBundle/Translations/en_US/messages.ini#L212-L213


Editing a Notification
======================
When you open or create a Notification under Web Notifications, the editor shows a live preview panel beside the **Heading**, **Message**, and **Action Button Text** fields. As you enter text in them, Mautic updates the matching elements in the preview, so you can see how the Notification looks without saving and reopening it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Form field labels: mautic.notification.form.heading="Heading", mautic.notification.form.message="Message", mautic.notification.form.button="Action Button Text" (not "Action button" — see correction).

Source: https://github.com/mautic/mautic/blob/c7cc81c3a967c6dc5fc69e37eef265d11d5297ef/app/bundles/NotificationBundle/Translations/en_US/messages.ini#L132-L137

Comment thread docs/channels/web_notifications.rst
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks for the review! We're addressing your requested changes — the Vale sentence-case warning on the section title and the spacing between the title underline and the first paragraph. We'll update the PR shortly.

@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Confirmed against the product source that "Notification" is capitalized throughout the UI, so we'll wrap the heading in a Vale off/on block (rather than lowercasing it) to clear the sentence-case warning, and add the missing blank line between the underline and the first paragraph. Applying both fixes now.

…k line

Reviewer adiati98 on PR mautic#932:
- Wrap the 'Editing a Notification' heading in a .. vale off/on block so
  Vale's sentence-case rule does not flag it; 'Notification' is a
  capitalized proper noun in the Mautic UI.
- Add a blank line between the heading underline and the first paragraph.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks @adiati98 — both points are addressed in this PR.

  • The Editing a Notification heading is now wrapped in a .. vale off / .. vale on block so it stays capitalized rather than being lowercased. "Notification" is capitalized throughout the Mautic UI (the Web Notifications menu, the Edit Web Notification editor header, and the preview placeholder), so this keeps the docs consistent with the product.
  • Added a blank line between the heading underline and the first paragraph.

Vale now runs clean on the file (0 errors, 0 warnings).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants