JMIX NotificationManager -> withContentType(ContentType.HTML) not rendering

The content type is unfortunately not described in the V2 docs, I assume that the HTML type renders the body?

image

        if (notificationHandler != null) {
            // Create Notification for Admins/Supporters.
            if(!ticketIO.getPriority().equals(TicketPriority.LOW)) {
                List<User> stuffsIO = UserHandler.getStuffs();
                List<String> usernamesIO = UserHandler.getUsernames(stuffsIO);

                    // Send Notification to Online Stuff Members.
                    notificationHandler.createNotification().withSubject(ticketIO.getName()).withRecipientUsernames(usernamesIO).toChannelsByNames("in-app").withHtmlContentType().withBody("<a href=\"/chat/?id=" + ticketIO.getId() + "\">"+ ticketIO.getId() + "</a>").send();
            }
        }

Hello!

Unfortunately, the HTML type is not supported for now, since there is no component can display/edit HTML.

Upd. I created an issue to support HTML content type, since RichTextArea will be available in 2.2:
Support HTML content type in IN-APP notifications · Issue #2922 · jmix-framework/jmix · GitHub

1 Like