File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed
Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -849,6 +849,15 @@ if ($response->isSuccess()) {
849849 */
850850 echo "\n tag -> name: ", $tag->name;
851851 }
852+ foreach ($messageTemplate->buttons as $button) {
853+ /**
854+ * @var $tag \Sendbee\Api\Models\MessageTemplateButton
855+ */
856+ echo "\n button -> index: ", $tag->index;
857+ echo "\n button -> type: ", $tag->type;
858+ echo "\n button -> title: ", $tag->title;
859+ echo "\n button -> value: ", $tag->value;
860+ }
852861 }
853862} else {
854863 /**
Original file line number Diff line number Diff line change 1515 * @property string $reject_reason Reject Reason
1616 * @property string $keyword Keyword
1717 * @property string $tags Tags
18+ * @property string $buttons Buttons
1819 * @property string $text Text
1920 * @property string $language Language
2021 * @property string $attachment Attachment
@@ -28,9 +29,10 @@ protected function getFieldSpecification(){
2829 'reject_reason ' => self ::fieldText (),
2930 'keyword ' => self ::fieldText (),
3031 'tags ' => self ::fieldModelCollection (MessageTemplateTag::class),
32+ 'buttons ' => self ::fieldModelCollection (MessageTemplateButton::class),
3133 'text ' => self ::fieldText (),
3234 'language ' => self ::fieldText (),
3335 'attachment ' => self ::fieldText (),
3436 ];
3537 }
36- }
38+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+
4+ namespace Sendbee \Api \Models ;
5+
6+
7+ use Sendbee \Api \Support \Model ;
8+
9+ /**
10+ * Class MessageTemplateButton
11+ * @package Sendbee\Api\Models
12+ *
13+ * @property integer $index index
14+ * @property string $type type
15+ * @property string $title title
16+ * @property string $value value
17+ */
18+ class MessageTemplateButton extends Model
19+ {
20+ protected function getFieldSpecification (){
21+ return [
22+ 'index ' => self ::fieldInteger (),
23+ 'type ' => self ::fieldText (),
24+ 'title ' => self ::fieldText (),
25+ 'value ' => self ::fieldText (),
26+ ];
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments