N
Novu•2y ago
empe

How to create a notification template for a topic?

Where I set the topic's notification template?
18 Replies
Pawan Jain
Pawan Jain•2y ago
You don't need a separate template for topic You can you same notification template
empe
empeOP•2y ago
wdym?
Pawan Jain
Pawan Jain•2y ago
You can any templates listed here https://web.novu.co/templates
Novu Manage Platform
Novu Manage Platform
empe
empeOP•2y ago
How?
Pawan Jain
Pawan Jain•2y ago
You want to trigger notification to a topic?
empe
empeOP•2y ago
Yes
Gali Baum
Gali Baum•2y ago
novu.trigger('delay6', {
to: [{
type: 'Topic', topicKey: 'delay2-topic-identifier'
}],
payload: {
name: '7'
}
});
}
novu.trigger('delay6', {
to: [{
type: 'Topic', topicKey: 'delay2-topic-identifier'
}],
payload: {
name: '7'
}
});
}
Pawan Jain
Pawan Jain•2y ago
Here delay6 is templateId
Gali Baum
Gali Baum•2y ago
delay6 can be any trigger identifier of your templates
empe
empeOP•2y ago
wow I've no idea of how I would come to realize this using the docs I'm like rereading this for several times already and it's not plain to understand at all 😅 btw still having trouble 😦
Pawan Jain
Pawan Jain•2y ago
Lets join over screen share @emilpearce
empe
empeOP•2y ago
Let me try one more thing The "delay6" = template identifier?
Pawan Jain
Pawan Jain•2y ago
yes
empe
empeOP•2y ago
That what was confusing Can we change that in the docs?
Pawan Jain
Pawan Jain•2y ago
<REPLACE_WITH_EVENT_NAME_FROM_ADMIN_PANEL> you mean this?
empe
empeOP•2y ago
const topicKey = 'posts:comment:12345';

await novu.trigger('<REPLACE_WITH_EVENT_NAME_FROM_ADMIN_PANEL>', {
to: [{ type: 'Topic', topicKey: topicKey }],
payload: {},
});
const topicKey = 'posts:comment:12345';

await novu.trigger('<REPLACE_WITH_EVENT_NAME_FROM_ADMIN_PANEL>', {
to: [{ type: 'Topic', topicKey: topicKey }],
payload: {},
});
to
const topicKey = 'posts:comment:12345';

await novu.trigger('<REPLACE_WITH_NOTIFICATION_TEMPLATE_IDENTIFIER>', {
to: [{ type: 'Topic', topicKey: topicKey }],
payload: {},
});
const topicKey = 'posts:comment:12345';

await novu.trigger('<REPLACE_WITH_NOTIFICATION_TEMPLATE_IDENTIFIER>', {
to: [{ type: 'Topic', topicKey: topicKey }],
payload: {},
});
Pawan Jain
Pawan Jain•2y ago
thanks
empe
empeOP•2y ago
Any time bro
Want results from more Discord servers?
Add your server