Free Mattermost Integration APP - Community Feedback Requested

I messaged the original developer Osya about his code and to get some estimate from him to finish it and here is his replay

The main problem with this task of Mattermost integration is requirements. I cant even rough estimate time because it depends on requirements. If you really need Mattermost integration I suggest you to start with writing good requirements.

According to my work during this task for Mattermost Integration. There were no requirements and I needed to create some prototype as fast as possible. So I created some simple web page with field for enter you message and field for view all messages. This web page sends requests to Mattermost server (it is regular requests, not Websockets). I suppose, it is not what you are expecting from the Mattermost Integration.

As I understand requirements should contains the following:

  1. At first it should be some module in Frappe framework. But it should be discussed with community. Probably it is better not to create separate module for Mattermost, but make some refactoring in Frappe and create one module for communication and/or notification. This module will contain not only Mattermost, but also email, SMS, and other notification channels. Probably tomorrow you will decide to integrate ERPNext with another messaging service. This new module should be extendable for new services.
  1. Then I suppose it doesn’t make sense to create some app in Frappe/ERPNext just for chatting. You can use good separate chat clients for this. Instead it should be deep integration with ERPNext. Some SMEs should decide in which ERPNext modules should be integration with Mattermost and how it should looks like. These changes in ERPNext modules for Mattermost integration will use base module for Mattermost integration from Frappe framework.
  2. And last my point - websockets should be used, not just GET/POST requests. Due to performance

As you see, to create good requirements needed discussion with Community and SMEs. And you see that deep integration of Mattermost with ERPNext is a big project, not a small simple task. This project should be planned somehow.

Creating Bounty is a good idea. Besides that I can recommend you to post job on Upwork. After good requirements will be ready and job posted on Bounty/Upwork I will probably come back to it.

He is quite right, we need to come up with generic way to integrate Mattermost with frappe. Generic in a way that we can define triggers and actions for any doctype, so the possibility will be limitless. for example, used for share, leave applications, new leads, new sale order… triggers can be defined for any model. so what do you guys think, how mattermost can be integrated into Frappe in generic way?

I think the way to look at this generically with minimal work is the following.

Frappe/ERPNext currently has ā€œEmail Alertsā€ that you can create. These are quite powerful and flexible. We would use the same concept here.

  1. Create an ā€œAlertā€ Doctype - you would use most of the same things as are currently there in Email Alert. In this way, it is completely flexible and user defined.
  2. Rather than worrying about which app (mattermost, rocketchat, slack, glip, etc) to use, just use a generic webhook. Most services accept webhooks. The ā€œrecipientā€ of the alert would be webhook location.

Use Sending messages using Incoming Webhooks | Slack documentation as an example.

  1. In slack, you would create a Webhook URL.
  2. In Alerts, you would paste the URL as the recipient
  3. When an alert is triggered, it would make an HTTP POST request to the Webhook URL in properly formatted JSON. For phase one, this can be as simple as the following

POST https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX Content-type: application/json { "text": "This is a line of text.\nAnd this is another one." }

If the post is successful (HTTP 200 OK) then great. If not, then put the response error in the error log.

As you go further along, you could, in theory, make ā€œAlertā€ completely generic. When you define an alert, you could define an Email recipient, an SMS recipient, a Webhook recipient, or more. This has the potential to be quite powerful.

5 Likes