How to create a link in a notification


#1

Hello guys,

I am trying to send a notification in a BPMN process where the user should click on a link.
The notification works ok :
<script cam-script type="text/form-script"> inject(function($scope, $http, $modal, $q, Notifications) { var str = "test"; var result = str.link("test.com"); Notifications.addMessage({type:"success",duration:50000, status:"Please copy in your browser", message:result});

   })

My problem is that message:result converts everything on a string and I end up with a string like this someText, everything is displayed as a string.

How can I solve this?
How can I end up with a clickable string in a notification message?
Thank you


#2

@AdrianAioanei you can refer this post might help you

Trigger feedback panel in tasklist


#3

Hello @aravindhrs
From there I have started.
Now the notification works but I can’t insert a valid link in notification message.


#4

You should prefix http protocol before the link test.com in the link function


#5

This doesn’t help.
I have http and the result is the same.
If i put in the string is not interpreted. Is displayed as a string the entire expression


#6

Hi,

for XSS protection, Notifications are escaped by default. If you know what you are doing, you can inject html to be rendered by adding unsafe: true to your Notification JSON.

Example:

Notifications.addMessage({
   type: 'success',
   message: 'YOUR_HTML',
   unsafe: true
});