Skip to content

Conversation

@derrickobedgiu1
Copy link
Contributor

@derrickobedgiu1 derrickobedgiu1 commented Oct 30, 2024

This PR includes support for button reply media headers (image, video, documents).

It maintains existing text header usage without breaking the code by simply swapping the current text header to an instance of a Text Button Reply Header class.

Reference: https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-reply-buttons-messages/

@derrickobedgiu1 derrickobedgiu1 marked this pull request as ready for review October 30, 2024 16:37
$header = new TextHeader($header);
}

if (!$header instanceof ButtonHeader && $header !== null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if is not necessary, should you use type hinting in the function:

 public function sendButton(string $to, string $body, ButtonAction $action, ?string | ?ButtonHeader $header = null, ?string $footer = null): Response

use Netflie\WhatsAppCloudApi\Message\ButtonReply\Header;

class ButtonReplyMessage extends Message
final class ButtonReplyMessage extends Message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class ButtonReplyMEssage yet exists in previous versions so you cannot convert it to final class because this is a breaking change (if anyone extended this class in our code you'll be breaking it)

@aalbarca aalbarca added the request changes PR reviewed but with request changes label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

request changes PR reviewed but with request changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants