Erpnext: [New Feature][Sponsored] Integrate Whatsapp for business

Created on 28 Sep 2019  路  28Comments  路  Source: frappe/erpnext

Hello community.

We will develop this new feature that is initially sponsored by @idolaru (Iulian_Olaru
in discourse).

We encourage the community and the frappe team to bring up ideas of how is the better way to approach this development in order to be integrated into the core.

@yashodhank can you please add the corresponding labels to this issue and make it visible to the developers of frappe team that you consider necessary.

Below we describe our first approach


New Integration

Captura de Pantalla 2019-09-28 a la(s) 10 22 29

Vendor to be defined:

  • Twilio: https://www.twilio.com/whatsapp
  • Nexmo: https://www.twilio.com/whatsapp
  • Messagebird https://www.messagebird.com/whatsapp/
  • Community proposals

[Option 1] SMS Center -> Message Center (Name to be defined)

  • Message type: SMS, Whatsapp

Captura de Pantalla 2019-09-28 a la(s) 10 04 02

[Option 2] Whatsapp Center

Captura de Pantalla 2019-09-28 a la(s) 10 27 25


Notification

Captura de Pantalla 2019-09-28 a la(s) 10 31 58


[Option 1] Send SMS -> Send Message (Name to be defined)

Captura de Pantalla 2019-09-28 a la(s) 10 06 41

[Option 2] Send Whatsapp

Captura de Pantalla 2019-09-28 a la(s) 09 53 45

Send Message/Whatsapp dialog

Captura de Pantalla 2019-09-28 a la(s) 10 17 36

Or

Captura de Pantalla 2019-09-28 a la(s) 10 18 02


  • Original issue #15412

  • Discussion: https://discuss.erpnext.com/t/discussion-and-proposal-whatsapp-implementation-bounty/53229/

Communication discussion version-12

All 28 comments

Seeing the screenshots is so helpful to imagine the development and I believe it's a great idea which many will use.

For Options 2 with Sending message on WhatsApp, would it be able to have the possibility to attach file, perhaps the print format of the doctype ?

In our business case, event prints could act as booking confirmations for customers and suppliers with WhatsApp phone numbers ... more than 70% at this moment.

Hello Ilaru!

Both options are with whatsapp, what we need is that we validate which would be the best way, but this is more referred to the frappe team, since it changes a lot as we would face the development, and especially to then accept the PR.

What we need is that they join to see which of the Vendors is the most convenient to integrate above all.

In the captures that we place are the possibility of attachments (they are mockups just as sure that small things are missing or have errors).

Regards!

I understand now better how the entire process works :-)

Well, in my simple mind having the attachment there is quite easy considering that sending an e-mail through the menu button of a doctype, the attachment field is there already.

Ideally the integration is built in a way, that also integrations with other chat services could be easily derived from it. Background: Using Whatsapp is not an option in Europe, as copying the address book (which Whatsapp, Telegram or Signal do) is not GDPR compliant for businesses. Thus companies often set up their own chat service to be used internally and with their partners, e.g. Rocket.Chat.

@rasos I will disagree on the GDPR idea. The system will not have access to copy the address book of any cell phone... Suppliers and customers give their automatic consent to receive WhatsApp messages during the business process.

Our customers for example are the ones who send us messages directly on WhatsApp and expect communication to be carried only there.

Other customers begin conversation on email and deliberately ask for moving the communication on WhatsApp.

For our suppliers we exclusively use WhatsApp.

GDPR only states that saving information without prior consent of the second party, is illegal. However, if there is written consent, you can save the phone number.

Once again, nobody is stealing anybody's address book... your opinion is very strange and it makes me believe you're not European... be that as it may, it's clear now.

The GDPR violation is not with ERPnext, but when installing Whatsapp on your Smartphone. In that moment, all your addressbook is synchronized with WhatsApp servers (unless you do not give access, which makes WhatsApp not useable anymore).

Yes, I am European and I am curious about privacy even if the contacts transferred may be hashed, but still it is sensible personal data. This is why in Europe many companies forbid their employees to install WhatsApp on the smartphone on which they have their business contacts. They should not be shared with facebook, who is the owner of WhatsApp.

But no offense and the data protection aspect is probably off-topic here. Your contribution will be very valuable and useful for many scenarios. My comment was just about a generic design of this integration if possible. This would allow to hook in even more messaging providers, including self-hosted solutions without central control. Just like the social login providers, that can be easily added to Frappe and which make us independent of just using Twitter, Google or Facebook login for single-sign-on.

Yes, the subject is way, significantly and very much outside the topic here.

Sticking to the integration side which is great idea ... perhaps we could have a base for future developments... on this I am not experienced to make comments but let's see what money can buy.

I have done some preliminary research, nothing in depth yet.

@fproldan For sending messages I prefer the Option 1 since it allows reuse of the same logic, however, think we can explore more options.

For 2-way messaging integration I can see a few methods of integrating it:

  1. Integrating with the Communication DocType (similar to Email Integration)
  2. Integrating with the Chat system in Frappe (I prefer this as this may provide instant notifications)
  3. Integrating with both (Chat for sending/receiving and Communication for linking messages with documents)

For vendor/API integration, I think we can follow the same method as SMS Setting. Or Slack WebHooks Setting where the user can define parameters, however, that depends on the complexity of the integration. I'm going through API documentations to get a high level idea about how it may work, this area still requires a lot more research.

Regarding getting the feature merged onto the main frappe and erpnext branch, I consider my responsibility limited to making the pull request with tests and making sure the PR meets the requirements. Reviewing and merging is the solely responsibility of the maintainers and I do not feel responsible if they are not merged.

Regarding collection of funds, I am still figuring out how and what to use to collect the bounties/funds. Most of the bounty/crowdsourcing platforms do not yet support my country.

Can we schedule a group call where we can discuss this and bounce off idea for this project from each other? @fproldan, @federicocalvo, @idolaru

It's important to know some limitations of WhatsApp Business API:

I think this makes it difficult to be merged into core since ERPNext cloud users won't benefit from it.

@SaiFi0102 unfortunate today is my last day of internet access after which I will be unreachable for the next 2 weeks.

I will be able to provide my feedback only after October 14th but you should not hold on the likes of me... keep going on because we are developing this for the good of everyone.

Funding wise I am happy to support it as long as it's a transparent development with a proper and stable end result :-)

@sagarvora there are options others than facebook's self hosted version. Twilio and many others provide SaaS solutions to WhatsApp API.

If a business wants WhatsApp integration and can benefit more than it's expense, I don't see how this is a problem.

@SaiFi0102 The option 1 or another similar approach is the way to go in our opinion due we can reuse logic and be able to add another messaging platform in the future (wechat, telegram, etc).

@sagarvora I think we should use Twilio (or another) saas solution instead of self-hosted version. There are many users in discourse interested in this feature.

@sagarvora - you will have to pay for unsolicited outgoing message no matter if self hosted or using an intermediary. In the long run self hosted will be cheaper - as long as you figure out where / how to host the docker container. Does it need to be on same VM?

For us, pulling incoming message into ERPNext is critical (like email). So Option 1 is not as appealing.

Lastly, on an unrelated note, if we do build a WhatsApp notification channel, is it lot of effort to do same for SMS? Using custom scripts, wondering why SMS channel does not exist?

@zerodiscount Incoming message into ERPNext will be a feature added in the second stage of this development.

If for self-hosted we need to get a server, I am happy to put an extra one on my rack with m247.com and pay for it.

After researching the integrations mentioned above, it seems to us that we should opt for Twilio as it is the most complete and mature of all, in addition to providing a testing environment that does not have the other integrations.

We believe it is not feasible to go for a self-hosted version as it considerably increases complexity and would limit the use to large companies in addition to requiring approval from Whatsapp to use it. More integrations can be added in the future besides Twilio.

We are going to add the Whatsapp Settings in integrations settings as the image below

Captura de Pantalla 2019-10-02 a la(s) 11 01 17

Feedback from the community and frappe are welcome.

That can work very well.

I believe ultimately the focus should be on what we can actually do with WhatsApp inside ERPNext.. it's flexibility.

It cannot be restricted to certain doctypes or certain goals. Example, WhatsApp integration should be able to be automatised to perform tasks depending on doctype status, data input etc.

Update?

Indeed, any update ?

Hi @idolaru ! In the PR ( https://github.com/frappe/erpnext/pull/19251 ) we already labeled people from frappe who are active, who are supposed to be busy with the conference.

If in a week we don't have an answer we'll see what can lead to a APP. Do you have your own server to download it in case we do one?

it's great if it's added this option to erpnext . but not very late :))

Any update?

Hi, just saw this thread. I had also been looking for whatsapp integration for a long time but could not find it. So instead we created another way to integrate whatsapp business with ERPNext. We send notifications to all our clients regarding their running orders for whatever is happening in the sales orders. I created a new gmail id, and configured various notifications for clients sending email to this particular email id. Then using google script, we pull the message body from teh email to a google sheet. Then again using google script, we send a whatsapp to the people concerned in that particular sales order.

To do this we had to make extensive customization in ERPNext forms, primarily adding new fields. We now cover all aspects of our work in sending notifications to our clients and are sending about 300 to 350 whatsapp messages every day. All of them are being sent automatically based on the entries being done in ERPNext. Been doing this for almost an year now.

Hi, just saw this thread. I had also been looking for whatsapp integration for a long time but could not find it. So instead we created another way to integrate whatsapp business with ERPNext. We send notifications to all our clients regarding their running orders for whatever is happening in the sales orders. I created a new gmail id, and configured various notifications for clients sending email to this particular email id. Then using google script, we pull the message body from teh email to a google sheet. Then again using google script, we send a whatsapp to the people concerned in that particular sales order.

To do this we had to make extensive customization in ERPNext forms, primarily adding new fields. We now cover all aspects of our work in sending notifications to our clients and are sending about 300 to 350 whatsapp messages every day. All of them are being sent automatically based on the entries being done in ERPNext. Been doing this for almost an year now.

Hi Amit,
Curious to know the solution you are using to send the Whatsapp messages

@federicocalvo hola, estoy viendo de cerca esto, porque en mi caso uso mucho los envi贸 de presupuesto y recibos de pago generados de en ERPnext por whatsapp, y por lo que estuve viendo la api de facebook whatsapp se puede usar con webhook. Al igual que Twilio, yo se que su idea es que este integrado en el nucleo pero bueno como yo no tengo tiempo para investigar y mi ingles es totalmente b谩sico les comento para ver que opinan.

@federicocalvo hello, I am watching this closely, because in my case I use the budget and receipts generated from ERPnext by whatsapp a lot, and from what I was seeing the facebook whatsapp api can be used with webhook. Like Twilio, I know that her idea is that it is integrated into the nucleus but well as I do not have time to investigate and my English is totally basic, I comment to see what they think.

https://www.twilio.com/docs/usage/webhooks

https://developers.facebook.com/docs/whatsapp/api/webhooks?locale=es_ES

Greatest Work Brother...
But How to deploy on ERPNext?

@japatel5213 This is deprecated, the frappe team is working on implementing this feature I guess it will be available in v13. https://github.com/frappe/frappe/pull/9623

@japatel5213 This is deprecated, the frappe team is working on implementing this feature I guess it will be available in v13. https://github.com/frappe/frappe/pull/9623

Okkk... Thanks...
And Brother you know any opensource email server like MailChimp(Its not Opensource) for HTML templates email sender Able integration to ERPNext.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

setsero71 picture setsero71  路  3Comments

GSLabIt picture GSLabIt  路  4Comments

cradford picture cradford  路  4Comments

giuseppelamatrice picture giuseppelamatrice  路  3Comments

nabinhait picture nabinhait  路  4Comments