#Hyperlinks best practices (Slack)

1 messages · Page 1 of 1 (latest)

dawn sinew
#

Hey guys, is still an issue ?
https://github.com/novuhq/novu/pull/4834

Is there a way to add hyperlinks that I should know of (in general, and in Slack), we are considering using novu, but not being able to add hyperlinks to notifications is something we are not willing to sacrifice.

GitHub

What change does this PR introduce?
Allows users to embed links in the message.
Why was this change needed?
Closes: #3548
Other information
Loom Video

This code was written and reviewed by GitStar...

hollow lichenBOT
#

Hi @dawn sinew, I'm an AI assistant for Novu. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @hollow lichen with any follow-up questions.

#

Answer

Regarding the GitHub issue you mentioned (https://github.com/novuhq/novu/pull/4834), I can't provide specific insights because the provided information sources do not cover it directly.

However, for adding hyperlinks in notifications, Novu supports dynamic data in the notification payload, which means you can include hyperlinks as part of the dynamic content. When crafting a notification, you can use variables within the notification template to include hyperlinks. Here's a code snippet illustrating how to include a hyperlink in a dynamic notification:

curl --location --request POST 'https://api.novu.co/v1/events/trigger' \
--header 'Authorization: ApiKey <REPLACE_WITH_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "password-reset",
"to": {
"subscriberId": "6427e97d0136cef86a315c46",
"email": "[email protected]"
},
"payload": {
"username": "Jhontheman1969",
"resetLink": "http://sample.info/password.reset",
"securityEmail": "[email protected]",
}
}'

(1)

For Slack specifically, Novu allows using webhook URLs to send notifications, which means you can format your messages with Slack's message formatting syntax to include links. You might need to set up your notifications to send in a format that Slack understands (including hyperlinks using <URL|text> syntax) within the payload you send to Novu for triggering the notification (2) .

Please verify these capabilities with the most current Novu documentation or the community, as product features can evolve.

dawn sinew
#

This leads to it being displayed as plain text

dawn sinew
#

I think I have tried it all,

<url|title> : either is removed from workflow message or if written like so: &lt;url|title&gt; is treated as plain text.
[title](url): is treated by slack as plain text, as slack doesn't use markdown
<a href="url">title</a>: same for html

Am I missing something or has this problem existed for more than a year and nobody has done anything about it ?

flat girder
#

@dawn sinew

Could you please use triple curly braces variable {{{resetLink}}} and then send resetLink value as <url|title>

dawn sinew
#

Ok it does work, thank you Pawan

flat girder
#

I will add this in doc

dawn sinew
#

hey @flat girder ,

I just want to share some feedback on the current flow, we might want to contribute to improve it, although there already is a PR open with the fix.

In the picture I'm sharing, I need to have slack specific variables because I am unable to build the url from generic variables (ex:
<https://myapp.com/{{id}}|{{name}}> would be ideal.

honest riverBOT
#

@dawn sinew, you just advanced to level 1!