N
Novu3mo ago
Norrude

Hyperlinks best practices (Slack)

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
NV-3548 - 🐛 Bug Report: Can't embed hyperlink in Slack message by g...
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...
9 Replies
Ask Inkeep
Ask Inkeep3mo ago
Hi @Norrude, 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 @Ask Inkeep with any follow-up questions. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Update subscriber credentials * How to send push notifications in an Android app (react native) with FCM and Novu * Windows * Workflow Editor -----------------------------
Ask Inkeep
Ask Inkeep3mo ago
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": "john.doe@acme.com"
},
"payload": {
"username": "Jhontheman1969",
"resetLink": "http://sample.info/password.reset",
"securityEmail": "john.doe.backup@acme.com",
}
}'
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": "john.doe@acme.com"
},
"payload": {
"username": "Jhontheman1969",
"resetLink": "http://sample.info/password.reset",
"securityEmail": "john.doe.backup@acme.com",
}
}'
(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.
Norrude
Norrude3mo ago
This leads to it being displayed as plain text 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 ?
Pawan Jain
Pawan Jain3mo ago
@Norrude Could you please use triple curly braces variable {{{resetLink}}} and then send resetLink value as <url|title>
Norrude
Norrude3mo ago
Ok it does work, thank you Pawan
Pawan Jain
Pawan Jain3mo ago
I will add this in doc
Norrude
Norrude3mo ago
hey @Pawan Jain , 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.
No description
Novu_Bot
Novu_Bot3mo ago
@Norrude, you just advanced to level 1!
Pawan Jain
Pawan Jain3mo ago
@Norrude Are you looking to have this supported natively in our chat step editor? <https://myapp.com/{{id}}|{{name}}>