Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending elements inside Structured message with data from database. #34

Closed
ekundayo-ab opened this issue Apr 28, 2017 · 5 comments
Closed

Comments

@ekundayo-ab
Copy link

How do i pull the message elements and button elements in a structured message from the database?

@wittfabian
Copy link
Contributor

What kind of database? Use case? Example?

@ekundayo-ab
Copy link
Author

ekundayo-ab commented Apr 28, 2017

$bot->send(new StructuredMessage($message['sender']['id'], StructuredMessage::TYPE_GENERIC, [
                         'elements' => [
                             new MessageElement("{$name}", "{$description}", "{$image}", [
                                 new MessageButton(MessageButton::TYPE_POSTBACK, 'Hello', "HELLO_PAYLOAD")
                                     ])
                             ]
                         ]
                     ));

I want the data in the "elements" be pulled from the database.

@wittfabian
Copy link
Contributor

This has nothing to do with this API. You should make a tutorial for the database!
What kind of database do you use?

@ekundayo-ab
Copy link
Author

Alright. Never mind MySQL though.

@wittfabian
Copy link
Contributor

wittfabian commented Apr 28, 2017

I can help you to implement your requirements. But I need more informations (database table structure, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants