With ListTemplate we can add a defaultAction when the element is clicked, like your example :
$defaultButton = new UrlButton(null, 'https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template');
$template->addElement('Moving list', 'Help you to check all of them', 'http://www.mk-sokolovi.com/wp/wp-content/uploads/2013/07/T-shirt-Vector.jpg')
->setDefaultAction($defaultButton)
->buttons()
->addWebButton('View', 'https://developers.facebook.com/docs/messenger-platform/send-api-reference/list-template');
Hi again,
With
ListTemplate
we can add a defaultAction when the element is clicked, like your example :but we can't do the same thing with
GenericTemplate
while it is mentioned in the Messenger's docs : https://developers.facebook.com/docs/messenger-platform/send-api-reference/generic-templateIt throws an exception :
Call to undefined method Casperlaitw\LaravelFbMessenger\Messages\Element::setDefaultAction()