Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Feature][Sponsored] Integrate Whatsapp for business #19196

Open
fproldan opened this issue Sep 28, 2019 · 20 comments

Comments

@fproldan
Copy link
Contributor

@fproldan fproldan commented Sep 28, 2019

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:


[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


@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Sep 28, 2019

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.

@federicocalvo

This comment has been minimized.

Copy link

@federicocalvo federicocalvo commented Sep 28, 2019

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!

@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Sep 28, 2019

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.

@rasos

This comment has been minimized.

Copy link
Contributor

@rasos rasos commented Sep 29, 2019

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.

@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Sep 29, 2019

@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.

@rasos

This comment has been minimized.

Copy link
Contributor

@rasos rasos commented Sep 29, 2019

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.

@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Sep 29, 2019

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.

@SaiFi0102

This comment has been minimized.

Copy link
Collaborator

@SaiFi0102 SaiFi0102 commented Sep 29, 2019

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

@sagarvora

This comment has been minimized.

Copy link
Contributor

@sagarvora sagarvora commented Sep 29, 2019

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.

@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Sep 30, 2019

@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 :-)

@SaiFi0102

This comment has been minimized.

Copy link
Collaborator

@SaiFi0102 SaiFi0102 commented Sep 30, 2019

@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.

@fproldan

This comment has been minimized.

Copy link
Contributor Author

@fproldan fproldan commented Sep 30, 2019

@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.

@zerodiscount

This comment has been minimized.

Copy link

@zerodiscount zerodiscount commented Sep 30, 2019

@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?

@fproldan

This comment has been minimized.

Copy link
Contributor Author

@fproldan fproldan commented Sep 30, 2019

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

@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Oct 1, 2019

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.

@fproldan

This comment has been minimized.

Copy link
Contributor Author

@fproldan fproldan commented Oct 2, 2019

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.

@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Oct 4, 2019

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.

@fproldan fproldan referenced this issue Oct 4, 2019
0 of 3 tasks complete
@Rashidsalim

This comment has been minimized.

Copy link

@Rashidsalim Rashidsalim commented Oct 28, 2019

Update?

@idolaru

This comment has been minimized.

Copy link

@idolaru idolaru commented Oct 28, 2019

Indeed, any update ?

@federicocalvo

This comment has been minimized.

Copy link

@federicocalvo federicocalvo commented Oct 29, 2019

Hi @idolaru ! In the PR ( #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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.