My Mautic version is: 2.16.2
My PHP version is: 7.0.31
My problem is:
I have mautic installation that work with twilio for send sms. Works fine. But I want to send message through whatsapp. I change in the mautic plugin the sender number and include the “whatsaap:” follow with the number sender approved on twilio. But when I send it show me an error message on Mautic.
[HTTP 400] Unable to create record: The ‘From’ number whatsapp:+15089805226 is not a valid phone number, shortcode, or alphanumeric sender ID.
But when I put only the number it work fine +15089805226. I made the validation process on Twilio and they approved to me send whatsapp message, and give instruction of change this on the send number.
I think that the library or the SDK of the plug in of twilio on mautic its too old? can you help to me?
The Twilio integration with Mautic works only for SMS. if you want to send whatsapp messages through mautic to Twilio you need a different approach. You should use a webhook action in a campaign that send the the payload to a Twilio endpoint that is intended to handle messages for WhatsApp
(xxxxxxxxxxxxxxx is your Twilio client id - same one you use in Mautic)
Method is POST Headers:
autorization: basic twilioclientid:twilioclientsecret (twilio credentials (along with “:”) should be encoded in base64. you can do it here https://www.base64encode.org)
From: your number (whatsapp+number)
To: number of recepient
Body: content of message
all Data fields support mautic tokens for fields (as you can see from screenshot)
Hi @jpgiron, you should set your ‘From’ number as +15089805226 and not whatsapp:+15089805226. If you applied the code block above, it should automatically prepend the ‘whatsapp:’ prefix to your ‘From’ number.
In our case, we have the same twilio number for sending SMS and sending via WhatsApp. If the Contact’s number has a ‘whatsapp:’ prefixed to it, then the code above will prepend ‘whatsapp:’ to the ‘From’ number and sends via WhatsApp, else, it will use the ‘From’ number as is then sends the message as SMS.
does not have, this line, that call to the file you indicate i need change.
with this, the change you indicate, now work. Also work when mautic get the answer of sms and/or whatsapp, and execute the instructions on a campaign! Now i can get also replied on whatsapp that execute campaign conditionals.
Very Thanks for your help! I think this work great now!
Yes, now works as a basic bot on whatsapp. Capture the answers and execute the campaign for send text message for example, basis on the conditional you put. Now i want to capture some answer and put as a contact field, because all answer get in the history interaction of mautic, but i want to capture some of them to store with the contact and send to another application. Do you have some idea of how to do that?