mautic / mautic

Mautic: Open Source Marketing Automation Software.
https://www.mautic.org
Other
7.34k stars 2.62k forks source link

Mautic does not sync opt-in/out with Twilio #11333

Closed coreyworrell closed 2 years ago

coreyworrell commented 2 years ago

Mautic Version

4.4.x series

PHP version

7.4

What browsers are you seeing the problem on?

Not relevant

What happened?

By default Mautic Twilio SMS callback only listens for the "stop" keyword, even though there are more default keywords that Twilio responds to (and allows any number of custom keywords to be used). And there is no action taken by Mautic at all if someone resubscribes through SMS by using the "start" and other keywords.

Twilio provides a parameter in the webhook request for special keywords, OptOutType, but currently Mautic does not use this. I recommend that Mautic look for this parameter rather than match the message against strings (as they could change at any time and can be overridden per account).

Details: https://www.twilio.com/docs/messaging/services/tutorials/advanced-opt-out?code-sample=code-add-number-to-numbers-pool&code-language=PHP&code-sdk-version=6.x#keeping-track-of-your-users-status

How can we reproduce this issue?

Step 1: Send SMS from Mautic through Twilio Step 2: Reply to SMS with "stopall" You'll see that contact is not marked as DNC. Step 3: Manually mark contact as DNC for SMS. Step 4: Reply to SMS again with "start". You'll see that contact is still marked as DNC.

Relevant log output

No response

Code of Conduct

jos0405 commented 2 years ago

Hi, this seems to me as a feature request and not even on the core, but on a plugin. Can you confirm that? Maybe makes sense to post it here? https://github.com/samjaninf/mautic-twillio-feedback-bundle

coreyworrell commented 2 years ago

@jos0405 the Twilio integration is part of core. And I consider it a bug because it does not support the default keywords or resubcribe functionality.

jos0405 commented 2 years ago

Hello @coreyworrell ! Thank for the feedback. You are right, the Twilio integration is part of the core. I checked the plugin settings an there is no functionality that supports keywords reading. It would be really nice to add it as an extra feature. It can be, that I'm mistaken, could you plz make a screenshot from the core Twilio plugin where you can define the keyword?

coreyworrell commented 2 years ago

What I am suggesting is not to rely on keywords, but rather to rely on the OptOutType parameter (which is one of START, STOP, or HELP) that Twilio sends in their incoming SMS webhook request to Mautic. That is more reliable as you would not need to specify keywords anywhere in Mautic.

jos0405 commented 2 years ago

I understand that Mautic should have this feature. I 100% agree with you. But it doesn't have. Unless I'm missing something (since I'm also just a user like you it's very mucht possible.) - in this case plz post a screenshot where this feature exists now. If it doesn't exists, I'd like to encourage you to post a feature request and not a bug report: mautic.org/forum

jos0405 commented 2 years ago

I can see you created the feature in the meanwhile. Thank you so much for your contribution! https://forum.mautic.org/t/twilio-sms-extensions-bundle-package-available-now/24756

github-actions[bot] commented 2 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If this issue is continuing with the lastest stable version of Mautic, please open a new issue that references this one.