bootdesk/chat-sdk

MessengerTemplate extends Template
in package

Table of Contents

Properties

$buttons  : array<string|int, mixed>|null
$coupon  : array<string|int, mixed>|null
$elements  : array<string|int, mixed>
$feedback  : array<string|int, mixed>|null
$media  : array<string|int, mixed>|null
$productId  : string|null
$receipt  : array<string|int, mixed>|null
$templateType  : string|null
$text  : string|null

Methods

__construct()  : mixed
__toString()  : string
addAccountLink()  : self
addAccountUnlink()  : self
addGamePlayButton()  : self
addPhoneNumberButton()  : self
addPostbackButton()  : self
addWebUrlButton()  : self
buttonTemplate()  : self
couponTemplate()  : self
create()  : self
customerFeedbackTemplate()  : self
genericTemplate()  : self
getLanguage()  : string
getName()  : string
mediaTemplate()  : self
productTemplate()  : self
receiptTemplate()  : self
toArray()  : array<string|int, mixed>
toMessenger()  : array<string|int, mixed>
buildButtonPayload()  : array<string|int, mixed>
buildCouponPayload()  : array<string|int, mixed>
buildFeedbackPayload()  : array<string|int, mixed>
buildGenericPayload()  : array<string|int, mixed>
buildMediaPayload()  : array<string|int, mixed>
buildProductPayload()  : array<string|int, mixed>
buildReceiptPayload()  : array<string|int, mixed>

Properties

Methods

__construct()

public __construct(string $name, string $language) : mixed
Parameters
$name : string
$language : string
public addAccountLink(string $url) : self
Parameters
$url : string
Return values
self

addGamePlayButton()

public addGamePlayButton(string $title, string $payload[, array<string|int, mixed>|null $gameMetadata = null ]) : self
Parameters
$title : string
$payload : string
$gameMetadata : array<string|int, mixed>|null = null
Return values
self

addPhoneNumberButton()

public addPhoneNumberButton(string $title, string $phoneNumber) : self
Parameters
$title : string
$phoneNumber : string
Return values
self

addPostbackButton()

public addPostbackButton(string $title, string $payload) : self
Parameters
$title : string
$payload : string
Return values
self

addWebUrlButton()

public addWebUrlButton(string $title, string $url[, string|null $webviewHeightRatio = null ]) : self
Parameters
$title : string
$url : string
$webviewHeightRatio : string|null = null
Return values
self

buttonTemplate()

public buttonTemplate(string $text, array<string|int, mixed> $buttons) : self
Parameters
$text : string
$buttons : array<string|int, mixed>
Return values
self

couponTemplate()

public couponTemplate(string $title, string $code[, string|null $redeemUrl = null ][, string|null $redeemButtonLabel = null ][, string|null $imageUrl = null ][, string|null $subtitle = null ]) : self
Parameters
$title : string
$code : string
$redeemUrl : string|null = null
$redeemButtonLabel : string|null = null
$imageUrl : string|null = null
$subtitle : string|null = null
Return values
self

create()

public static create(string $name[, string $language = 'en_US' ]) : self
Parameters
$name : string
$language : string = 'en_US'
Return values
self

customerFeedbackTemplate()

public customerFeedbackTemplate(string $title, string $businessAddress, array<string|int, mixed> $ratingOptions[, string|null $followUpAction = null ][, string|null $feedbackPrivacyUrl = null ]) : self
Parameters
$title : string
$businessAddress : string
$ratingOptions : array<string|int, mixed>
$followUpAction : string|null = null
$feedbackPrivacyUrl : string|null = null
Return values
self

genericTemplate()

public genericTemplate(array<string|int, mixed> $elements) : self
Parameters
$elements : array<string|int, mixed>
Return values
self

getLanguage()

public getLanguage() : string
Return values
string

getName()

public getName() : string
Return values
string

mediaTemplate()

public mediaTemplate(string $url, string $mediaType[, array<string|int, mixed>|null $button = null ]) : self
Parameters
$url : string
$mediaType : string
$button : array<string|int, mixed>|null = null
Return values
self

productTemplate()

public productTemplate(string $productId) : self
Parameters
$productId : string
Return values
self

receiptTemplate()

public receiptTemplate(string $recipientName, string $orderNumber, string $currency, string $paymentMethod, string $orderUrl, array<string|int, mixed> $elements[, array<string|int, mixed>|null $summary = null ][, array<string|int, mixed>|null $adjustments = null ][, string|null $timestamp = null ]) : self
Parameters
$recipientName : string
$orderNumber : string
$currency : string
$paymentMethod : string
$orderUrl : string
$elements : array<string|int, mixed>
$summary : array<string|int, mixed>|null = null
$adjustments : array<string|int, mixed>|null = null
$timestamp : string|null = null
Return values
self

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toMessenger()

public toMessenger() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildButtonPayload()

private buildButtonPayload() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildCouponPayload()

private buildCouponPayload() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildFeedbackPayload()

private buildFeedbackPayload() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildGenericPayload()

private buildGenericPayload() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildMediaPayload()

private buildMediaPayload() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildProductPayload()

private buildProductPayload() : array<string|int, mixed>
Return values
array<string|int, mixed>

buildReceiptPayload()

private buildReceiptPayload() : array<string|int, mixed>
Return values
array<string|int, mixed>
On this page

Search results