Skip to content

Commit 6a58604

Browse files
fix vale
1 parent d5df5a5 commit 6a58604

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

docs/design/notifications.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ Accessibility
4141
- Notifications should be accessible and not rely solely on color to convey status, as this can be problematic for Users with color blindness, so use additional HTML attributes according to the notification type.
4242
- Toast notifications with interactive content shouldn't automatically disappear to remain WCAG 2.1 compliant.
4343

44-
Using notification components
44+
.. vale off
45+
46+
Using notification Components
4547
=============================
4648

49+
.. vale on
50+
4751
Standard notifications with icons
4852
---------------------------------
4953

@@ -86,11 +90,11 @@ This creates a more substantial notification block with a heading and paragraph,
8690
Notifications for the notifications panel
8791
=========================================
8892

89-
Notifications under the panel are managed through the ``NotificationModel`` class, which is defined in ``NotificationModel.php``.
93+
The ``NotificationModel`` class in ``NotificationModel.php`` manages notifications under the panel.
9094

9195
.. note::
9296

93-
The notification template is defined in ``notification.html.twig``.
97+
The system defines the notification template in ``notification.html.twig``.
9498

9599
Creating a notification
96100
-----------------------
@@ -122,19 +126,19 @@ Parameters:
122126
123127
- ``$message`` (string): the main content of the notification.
124128
- ``$type`` (string|null): identifies the source and style of the notification (optional).
125-
- ``$isRead`` (boolean): indicates if the notification has been read (default: true).
129+
- ``$isRead`` (boolean): indicates if the system has marked the notification as read (default: true).
126130
- ``$header`` (string|null): the header text for the notification (required).
127131
- ``$iconClass`` (string|null): CSS class for the notification icon (for example, 'ri-eye-line').
128132
- ``$datetime`` (\\DateTime|null): creation date of the notification.
129-
- ``$user`` (User|null): User object associated with the notification (defaults to current user).
133+
- ``$user`` (User|null): the User object associated with the notification defaults to the current User.
130134
- ``$deduplicateValue`` (string|null): used to prevent duplicate notifications within a specified timeframe.
131135
- ``$deduplicateDateTimeFrom`` (\\DateTime|null): customizes the ``deduplication timeframe``.
132136

133137
.. vale on
134138
135139
.. note::
136140

137-
The header should only contain the translation string; Twig will handle the translation.
141+
The header should only contain the translation string; Twig handles the translation.
138142

139143

140144
Notification types
@@ -154,7 +158,7 @@ The ``$type`` parameter determines the visual style of the notification:
154158
Example usage
155159
-------------
156160

157-
Here's an example of how to create a notification when a Contact export is scheduled:
161+
Here's how to create a notification when you schedule a Contact export:
158162

159163
.. code-block:: php
160164
@@ -175,8 +179,8 @@ Here's an example of how to create a notification when a Contact export is sched
175179
);
176180
}
177181
178-
This use case showcases how the NotificationModel can be integrated into event-driven processes within Mautic.
182+
This use case shows how to integrate the NotificationModel into event-driven processes within Mautic.
179183
This example calls the ``addNotification`` method with specific parameters tailored to the Contact export scenario. The Translator service handles the ``$message`` parameter to generate a localized message. This approach includes the User's Email address in the notification message. The system uses the translation key ``mautic.lead.export.being.prepared`` with the parameter ``%user_email%``, replacing it with the actual Email of the User who scheduled the export. This method allows for dynamic content insertion into the translated string.
180-
If the User's Email wasn't necessary in the message, a normal translation string could have been used without parameter replacement.
184+
If the User's Email weren't needed in the message, the system could have used a normal translation string without parameter replacement.
181185

182-
The other parameters in the ``addNotification`` call are equally important. The system styles the notification as an informational alert using the ``info`` type, which is appropriate for a status update on a scheduled task. The false value for ``$isRead`` ensures that the notification appears as unread, drawing the User's attention to this new information. The header, like the message, uses a translation key ``mautic.lead.export.being.prepared.header`` to maintain language consistency. Null values for the icon class and ``datetime`` mean that the system will use default values for these optional parameters. Finally, by passing the $user object, the notification is specifically associated with the user who initiated the export, ensuring it appears in their personal notification panel.
186+
The other parameters in the ``addNotification`` call are equally important. The system styles the notification as an informational alert using the ``info`` type, which is appropriate for a status update on a scheduled task. The false value for ``$isRead`` ensures that the notification appears as unread, drawing the User's attention to this new information. The header, like the message, uses a translation key ``mautic.lead.export.being.prepared.header`` to maintain language consistency. Null values for the icon class and ``datetime`` mean that the system uses default values for these optional parameters. Finally, by passing the ``$user`` object, the notification is specifically associated with the user who initiated the export, ensuring it appears in their personal notification panel.

0 commit comments

Comments
 (0)