Topic on User talk:MSchottlender-WMF

Is there an example extension for creating a new Echo notification type?

3
Joeytje50 (talkcontribs)

Hey Moriel, I'm currently working on an extension that creates a new notification type for Echo, but after following Extension:Echo/Creating a new notification type I get some errors which I can't seem to be able to fix. I've tried using some other ways to make my extension work, but I can't get it to work still.

I've watched the video that's on that page, and if I'm correct you mentioned on there that there would be an example extension for creating a new notification type. Do you know if that extension already exists? I think that if I have an example to work with to be able to see where my extension goes wrong.

Mooeypoo (talkcontribs)

What errors are you getting with the notification type? is the event created?

There's no example extension per say -- you could just take a look at current examples from extensions that already create notifications, like Thanks. There are also examples of the notifications in Echo itself that might help...

Joeytje50 (talkcontribs)

The errors I'm getting are problems with using $this. I'm not currently sitting at the computer with my code, but in several files I've had the problem that I had to use the static syntax instead of using $this, for example in the line

        'excerpt' => EchoDiscussionParser::getEditExcerpt( $revision, $this->getLanguage() ),

but also in the function locateUsersInList, with the line

        $userIds = $this->getList( $listId )->getUsers();

which all claim I can't use $this.

Now I've tried working around that and doing that I did manage to register my new notification type in Special:Preferences, but other than that I never got the notifications to get sent to users.

Reply to "Is there an example extension for creating a new Echo notification type?"