# How to provide custom URL for notification

**URL:** https://meta.discourse.org/t/how-to-provide-custom-url-for-notification/60273
**Category:** Development
**Created:** [April 1, 2017, 6:44am UTC](https://meta.discourse.org/t/how-to-provide-custom-url-for-notification/60273 "2017-04-01T06:44:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jafeth.diazc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jafeth.diazc/32/101197_2.png) [@jafeth.diazc](https://meta.discourse.org/u/jafeth.diazc)
#### Post date: [April 1, 2017, 6:44am UTC](https://meta.discourse.org/t/how-to-provide-custom-url-for-notification/60273/1 "2017-04-01T06:44:40Z")

</div>

Hi,

I know that if I create a custom type notification, I can provide a `data.message` field with a I18n scope value to form the text of the notification. This is the code in the `notification-item` widget:

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/notification-item.js.es6#L66-L90](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/notification-item.js.es6#L66-L90)

However, in the function that generates the URL, I don’t see a way to return a custom URL in case the notification’s type is custom:

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/notification-item.js.es6#L25-L55](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/notification-item.js.es6#L25-L55)

I was thinking in reopening the widget and add code for such extra case, but the widget is not being exported ☹

What could be a solution for this? I’d appreciate some help.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [April 6, 2017, 8:22pm UTC](https://meta.discourse.org/t/how-to-provide-custom-url-for-notification/60273/2 "2017-04-06T20:22:02Z")

</div>

Still blocked on this? Any new findings to share?

---

<div class="post-metadata">

### Author: ![jafeth.diazc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jafeth.diazc/32/101197_2.png) [@jafeth.diazc](https://meta.discourse.org/u/jafeth.diazc)
#### Post date: [April 6, 2017, 11:49pm UTC](https://meta.discourse.org/t/how-to-provide-custom-url-for-notification/60273/3 "2017-04-06T23:49:16Z")

</div>

Yes ☹

I expected to hear from an experienced developer whether creating custom notifications is something “advisable”. I say this since I haven’t seen plugins doing it (if someone has, please let me know) nor many topics related (others than [this one](https://meta.discourse.org/t/creating-custom-notifications/58950), which I’ve followed to create a custom notification from the backend).

In any case, I was thinking in submitting a PR to add something like the following snippet at the bottom of the url method. That would solve my problem and even be useful for other plugin developers.

```
if (attrs.notification_type === CUSTOM_TYPE) {
  return data.custom_url;
}

```

Even if it’s not worth its merging, I think I could reopen the widget and do the same, but I would need the widget to be exported, so another PR 😅

I hope to get some advice for my issue this time 🙂

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 7, 2017, 2:00pm UTC](https://meta.discourse.org/t/how-to-provide-custom-url-for-notification/60273/4 "2017-04-07T14:00:53Z")

</div>

My current thought around notifications is to move away from custom all together.

If you need a new notification type you should send through a PR to reserve the number for core.

The “custom” thing just became super messy.
