dpi / courier

Courier is a Drupal module providing a framework to send messages to entities.
https://drupal.org/project/courier
GNU General Public License v2.0
8 stars 3 forks source link

Slack / Mattermost integration #33

Closed mirodietiker closed 8 years ago

mirodietiker commented 8 years ago

We are using Mattermost and i would love to see some events / notifications propagated to our mattermost channel.

Sure, i guess, can be a separate module, say courier_mattermost. It's a trivial REST POST resource with a key and a body. We can make the key globally configurable for now.

The difference here is that it's a channel and not a message to an individual. So it is not a full replacement for the direct message to the individual and more an additional notification.

With our proposed in TMGMT courier integration we would expect to simply add a new template collection to the same trigger.

dpi commented 8 years ago

I can help out, but I dont think I be including channels in Courier core that Drupal core doesnt natively support.

dpi commented 8 years ago

From what I understand Mattermost is Slack API-compatible?

https://github.com/maknz/slack would reduce the complexity of the integration

mirodietiker commented 8 years ago

Yeah it is Slack compatible.

But just posting to the API is so much simple... It feels kinda overkill to use a library for that. I guess the access key settings form is the most complex part. ;-)

dpi commented 8 years ago

I think if I were doing the integration, I would also create a new identity type, where each identity mapped to one of the Slack/MM channels. That way you would target the sendMessage identity at the Slack channel, as you wouldnt target a Drupal user (?).

mirodietiker commented 8 years ago

Yeah, ability to target a channel would make sense. Or also a private conversation. But again since the recipient is a different identity, you tell me i need to write code to trigger that message?

We need to be able to add a second message instance to an existing code trigger with a recipient override to give the UI sense and flexibility.

dpi commented 8 years ago

You don't need a different template template collection.

If you are looking at the code from dpi/tmgmt#1. You would add the entity mapping to the Slack channel to the $users array in Notification service.

dpi commented 8 years ago

I whipped up something over lunch:

slackcourier

dpi commented 8 years ago

I've put it up here: https://github.com/dpi/courier_slack

The code is very rough, only a couple of hours worth of work. I used the composer dependency to get on my feet faster.

If you're wish to improve the module I can add a co-maintainer. Since I do not have much free time for the near future.

dpi commented 8 years ago

Continue discussions at https://github.com/dpi/courier_slack

mirodietiker commented 8 years ago

Thank you, this is awesome. :-)