Base solution for your next web application
Open Closed

Using HTML for notifications #8879


User avatar
0
BobIngham created

.net core, angular, aspnet 4.6.0, Zero 6.8.0 I want to format my notifications with html: I have a send notifications page: I build the notification in the server method:

            var notificationData = new LocalizableMessageNotificationData(
                new LocalizableString(
                    "NuagecareNotification",
                    NuagecareConsts.LocalizationSourceName
                )
            );
            notificationData["notificationHeader"] = input.NotificationHeader;
            notificationData["notificationMessage"] = input.NotificationMessage;
            notificationData["from"] = input.From;

and want to format it as follows:

      <text name="NuagecareNotification">
          <![CDATA[<h5 class="text-muted">{notificationHeader}</h5>
                   <p>{notificationMessage}</p>
                   <p>from {from}</p>]]>
      </text>

This would give me better layout that is currently the case:

I also need to have a hyperlink in some messages for documents held in Blob Storage to be read. Angular code seems to use IFormattedUserNotification and I'm not sure how I would go about this? Any pointers anyone?


2 Answer(s)