Skip to content

Commit

Permalink
Fix optional footer for interactive list messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aalbarca committed Feb 6, 2023
1 parent d08198b commit 8dabc27
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Request/MessageRequest/RequestOptionsListMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class RequestOptionsListMessage extends MessageRequest
*/
public function body(): array
{
return [
$request = [
'messaging_product' => $this->message->messagingProduct(),
'recipient_type' => $this->message->recipientType(),
'to' => $this->message->to(),
Expand All @@ -23,9 +23,14 @@ public function body(): array
'text' => $this->message->header(),
],
'body' => ['text' => $this->message->body()],
'footer' => ['text' => $this->message->footer()],
'action' => $this->message->action(),
],
];

if ($this->message->footer()) {
$request['interactive']['footer'] = ['text' => $this->message->footer()];
}

return $request;
}
}

0 comments on commit 8dabc27

Please sign in to comment.