netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
456 stars 166 forks source link

Feat: Support for Whatsapp ID on Send Contact API #39

Closed vicenterusso closed 1 year ago

vicenterusso commented 1 year ago
"phones": [
    {
        "phone": "<whatsapp-number>",
        "type": "CELL",
        "wa_id": "<whatsapp-number>"
    }
]

The code bellow should include the wa_id like above. If not present, the Contact is not recognized as whatsapp number and it displays the button "Invite to Whatsapp".

https://github.com/netflie/whatsapp-cloud-api/blob/258aa652fd155b60310728480cdf89d1998e6b49/src/Request/RequestContactMessage.php#L36

Willing to help sending PR later, But I'm not well versed in tests.

aalbarca commented 1 year ago

Hi @vicenterusso

Thanks for your report. I'll add support for wa_id on contact phones.

Thanks :)

vicenterusso commented 1 year ago

Just a note:

In my country, the "wa_id" is not the same as my cell number. For example:

My cellphone format: 44 66 99999-9999 (extra number) My whatsapp id: 44 66 9999-9999

So, maybe an extra optional parameter (if null uses cell phone) for the whatsapp id could be the best option

Please check PR: https://github.com/netflie/whatsapp-cloud-api/pull/41