Does novu support sending messages to slack in markdown

I want to send the message in table form in a slack channel via novu. How can this be achieved?
8 Replies
Ask Inkeep
Ask Inkeep6mo ago
Hi @Aayush Rathore, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Slack * How to use Novu to send notifications to a Slack channel * Chat * Glossary -----------------------------
Ask Inkeep
Ask Inkeep6mo ago
Answer Novu supports sending richly formatted Slack messages using blocks, which allow for various layouts including sections, dividers, and even tables. To send a message in table form, you would typically use the "blocks" feature in Slack's Block Kit (1) . Here's an example of how you can send a Slack message with a table using Novu:
const novu = new Novu('<NOVU_API_KEY>');

await novu.trigger('slack', {
to: {
subscriberId: '<SUBSCRIBER_ID>'
},
payload: {
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: 'Here is a table:'
}
},
{
type: 'section',
fields: [
{
type: 'mrkdwn',
text: '*Column 1*'
},
{
type: 'mrkdwn',
text: '*Column 2*'
}
]
},
{
type: 'section',
fields: [
{
type: 'plain_text',
text: 'Row 1 Item 1'
},
{
type: 'plain_text',
text: 'Row 1 Item 2'
}
]
},
{
type: 'section',
fields: [
{
type: 'plain_text',
text: 'Row 2 Item 1'
},
{
type: 'plain_text',
text: 'Row 2 Item 2'
}
]
}
]
}
});
const novu = new Novu('<NOVU_API_KEY>');

await novu.trigger('slack', {
to: {
subscriberId: '<SUBSCRIBER_ID>'
},
payload: {
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: 'Here is a table:'
}
},
{
type: 'section',
fields: [
{
type: 'mrkdwn',
text: '*Column 1*'
},
{
type: 'mrkdwn',
text: '*Column 2*'
}
]
},
{
type: 'section',
fields: [
{
type: 'plain_text',
text: 'Row 1 Item 1'
},
{
type: 'plain_text',
text: 'Row 1 Item 2'
}
]
},
{
type: 'section',
fields: [
{
type: 'plain_text',
text: 'Row 2 Item 1'
},
{
type: 'plain_text',
text: 'Row 2 Item 2'
}
]
}
]
}
});
This example shows how to structure a simple table with Markdown in Slack using Novu. Adjust the text and fields content as per your table data requirements.
Ask Inkeep
Ask Inkeep6mo ago
Got it. Tagging @Support for additional help.
Dima Grossman
Dima Grossman6mo ago
Hi! this can be achieved with our new framework: https://docs.novu.co/echo/quickstart
Novu
Quick Start - Novu
Novu Echo, the Code-first notification workflow engine. Build advanced workflows while giving your non-technical teammates complete control over content and behaviour.
Pawan Jain
Pawan Jain6mo ago
@Aayush Rathore Did you get a chance to checkout code first approach to send notifications https://docs.novu.co/framework/quickstart checkout this example on how you can send slack block messages https://docs.novu.co/framework/steps/chat#provider-overrides
Aayush Rathore
Aayush RathoreOP6mo ago
@Pawan Jain in the mentioned framework, support for node is given. I want to do this in golang. Minimum requirement is to send an embedded hyperlink in the slack chat
Pawan Jain
Pawan Jain6mo ago
@Aayush Rathore code first approach is currently supported in javascript based framework libraries. If you are looking to just send hyperlink, checkout this answer https://discord.com/channels/895029566685462578/1221758432915488809/1221820631579099217
Aayush Rathore
Aayush RathoreOP6mo ago
@Pawan Jain It helps, thank you
Want results from more Discord servers?
Add your server