From 90941152ff5d4f0308c90a0167fbaa9e416d7c49 Mon Sep 17 00:00:00 2001 From: Brant Wynn Date: Wed, 24 May 2017 17:27:03 -0500 Subject: [PATCH] Add the List Template message plugin --- src/Message/ListMessage.php | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 src/Message/ListMessage.php diff --git a/src/Message/ListMessage.php b/src/Message/ListMessage.php new file mode 100755 index 0000000..34bc434 --- /dev/null +++ b/src/Message/ListMessage.php @@ -0,0 +1,56 @@ +listElements = $listElements; + } + else { + throw new \InvalidArgumentException("Invalid elements array."); + } + } + + /** + * {@inheritdoc} + */ + public function getFormattedMessage() { + return [ + 'attachment' => [ + 'type' => 'template', + 'payload' => [ + 'template_type' => 'list', + 'elements' => $this->listElements, + ], + ], + ]; + } + +}