# Mautic Integration with Twilio to send message to Whatsapp

**URL:** <https://forum.mautic.org/t/mautic-integration-with-twilio-to-send-message-to-whatsapp/14596>\
**Category:** Product Support\
**Created:** [June 1, 2020, 11:30pm UTC](https://forum.mautic.org/t/mautic-integration-with-twilio-to-send-message-to-whatsapp/14596 "2020-06-01T23:30:31Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![josephsinnaco](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/josephsinnaco/32/864_2.png) [@josephsinnaco](https://forum.mautic.org/u/josephsinnaco)\
**Post date:** [July 18, 2020, 7:50am UTC](https://forum.mautic.org/t/mautic-integration-with-twilio-to-send-message-to-whatsapp/14596/8 "2020-07-18T07:50:05Z")

</div>

> [@josephsinnaco](#):
>
> ```auto
> / *****Add Support to WhatsApp***** /
> $prefix = '';
> if($number){
> if(strlen($number)>9){
> if(substr($number, 0, 9) === 'whatsapp:'){
> $prefix = 'whatsapp:';
> $number = substr($number, 9);
> }
> }
> }
> / *********************************** /
>         
> $this->client->messages->create(
> $prefix.$this->sanitizeNumber($number),
> [
> 'from' => $prefix.$this->sendingPhoneNumber,
> 'body' => $content,
> ]
> );
> 
> ```

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.

---

_[View the full topic](https://forum.mautic.org/t/mautic-integration-with-twilio-to-send-message-to-whatsapp/14596)._
