Chatfuel Quote of the Day Messenger Chatbot Example + Tutorial + Template

Simple Mortgage Calculator and Lead Generation for Real Estate using Chatfuel
How to Create a Mortgage Calculator for Mortgage and Real Estaate Lead Generation
October 5, 2017
20 niches and industries to dominate with chatbots
20 Industries & Niches Ready to be Dominated by AI and Chatbots
October 11, 2017
Show all

Chatfuel Quote of the Day Messenger Chatbot Example + Tutorial + Template

Quote of the day Chatbot template

Chatfuel for Messenger

Chatfuel is our preferred platform for building bots, it’s simple, user-friendly and you can deploy bots QUICKLY. No programming skills or knowledge required, build your blocks, drag-and-drop your sequence and attach to your Facebook Business Page.

Who Can Benefit – How to Use?

Chatbots are relatively new and while they are EXTREMELY powerful it can be difficult to envision how to effectively deploy and use them. This chatbot is a SIMPLE, engaging value add chatbot for any brand, business or Facebook Page that wants to add value to the experience of followers, customers and potential customers. It’s a non-salesy way to meet and engage with consumers and build meaningful and trusting relationships.

Some of brands, industries and niches that could benefit from this bot;

  • Churches
  • Cities & Municipalities
  • Elected Officials
  • Organizations & Clubs
  • Schools & Universities
  • Retail
  • Insurance
  • Pretty much any public facing or B2C business or brand!

Chatfuel Daily Quote Chatbot Requirements

  • Intermediate level of knowledge and comfort for to deploy this chatbot.
  • Access to a webserver (or a partner/employee that can deploy a PHP file)
  • A Chatfuel account
  • 15-30 Minutes of time!

Let’s start building

Create a new chatbot … OR … create a new group or block within your bot. Within your bot, add a JSON API plugin into your bot.

Step 1 – Create Bot, Group or Block and Find JSON API Plugin

Chatfuel Quote of the Day Bot

Step 2 – Install the JSON API Plugin

Connecting and installing a Chatfuel JSON API plugin

Step 3 – Configure the JSON API URL (see step 4 for URL)

Configuring a chatfuel JSON API plugin

Step 4 – Install PHP File on Server

You will need a server to install a PHP file that is called in the JSON API. If you are not familiar with web development or this means nothing to you, reach out to a colleague, friend or vendor and ask them to install it for you … OR … You can always ask us for help! Click here to download the PHP file (zip file) or scroll to bottom for the code. Once installed, you will need the file path to the server to use in the step 3 URL configuration. The file is plug-n-play, install it and it will magically work.

Step 5 – Connect Bot to Facebook Page (if you have not done so yet!)

Connecting chatfuel to a page.

 

Limitations

You are limited to 10 calls per hour, so use it sparingly while testing. As you build a subscriber base, you can use the Chatfuel Broadcast tool to send daily messages to your subscribers!

TEST BOT – Click Button Below (check your after clicking)

PHP Code

Please do not make fun of the code 🙂 Much of it’s hardcoded and not according to what many consider best practice but I am a HUGE evangelist of the saying “Don’t let perfection get in the way of progress!



$DEBUG_MODE=0;

//TEST DATA FOR DEBUG MODE, THIS WILL PREVENT YOU FROM CONSUMING 10 CALLS / HOUR DURING TESTING
$test_data =”{
\”success\”: {
\”total\”: \”1\”
},
\”contents\”: {
\”quotes\”: [
{
\”quote\”: \”I know for sure that what we dwell on is who we become.\”,
\”length\”: \”55\”,
\”author\”: \”Oprah Winfrey\”,
\”tags\”: [
\”dwell\”,
\”inspire\”,
\”motivational\”
],
\”category\”: \”inspire\”,
\”date\”: \”2017-10-08\”,
\”permalink\”: \”https://theysaidso.com/quote/lVOKTTrO7g0OrJjlWaJ2oQeF/oprah-winfrey-i-know-for-sure-that-what-we-dwell-on-is-who-we-become\”,
\”title\”: \”Inspiring Quote of the day\”,
\”background\”: \”https://theysaidso.com/img/bgs/man_on_the_mountain.jpg\”,
\”id\”: \”lVOKTTrO7g0OrJjlWaJ2oQeF\”
}
],
\”copyright\”: \”2017-19 theysaidso.com\”
}
}”;

//QUOTES API URL
$url = “https://quotes.rest/qod”;

//DEBUG MODE SWITCH, PROCESS TEST DATA WHILE IN DEBUG MODE
if ($DEBUG_MODE == 1) {
$json_data = json_decode($test_data, true);
} else {
$result = file_get_contents($url);
$json_data = json_decode($result, true);
}

foreach($json_data[‘contents’][‘quotes’] as $item) {
$qod=$item[‘quote’];
$qod_image=$item[‘background’];
$qod_link=$item[‘permalink’];
}

//FOR BROWSER TESTING – TURNED OFF, ONLY TURN ON WHEN TESTING IN BROWSER
if ($DEBUG_MODE == 1) {
//print_r(“Quote of the Day: “.$qod.”
Image URL: “.$qod_image.”
Link: “.$qod_link.””);
}

/* $build_code = ”
{\”messages\”:[{\”attachment\”:{\”type\”:\”template\”,\”payload\”:{\”template_type\”:\”generic\”,\”elements\”:[{
\”title\”:\”Welcome to Peters Hats\”,
\”image_url\”:\”https://petersfancybrownhats.com/company_image.png\”,
\”subtitle\”:\”Weve got the right hat for everyone.\”,
\”default_action\”: {
\”type\”: \”web_url\”,
\”url\”: \”https://peterssendreceiveapp.ngrok.io/view?item=103\”,
\”webview_height_ratio\”: \”tall\”,
\”fallback_url\”: \”https://peterssendreceiveapp.ngrok.io/\”},
\”buttons\”:[
{
\”type\”:\”web_url\”,
\”url\”:\”https://peterssendreceiveapp.ngrok.io\”,
\”title\”:\”View Local Comps\”
}]}]}}}]}”;*/

//CHANGE PAYLOAD/TEMPLATE AS NEEDED
$build_code =
“{
\”messages\”:[
{
\”attachment\”:{
\”type\”:\”template\”,
\”payload\”:{
\”template_type\”:\”generic\”,
\”elements\”:[
{
\”title\”:\””.$qod.”\”,
\”image_url\”:\””.$qod_image.”\”,
\”subtitle\”:\”Follow Us for Daily Inspiration!!\”,
\”buttons\”:[
{
\”type\”:\”show_block\”,
\”block_names\”: [\”Welcome message\”],
\”title\”:\”Main Menu\”
},
{
\”type\”:\”element_share\”
}
]
}
]
}
}
}
]
}”;

print_r($build_code);

?>

Michael Lucy
Michael Lucy

Michael Lucy is an avid digital marketer with a deep rooted passion for anything and everything involving technology. From programming to SEO to PPC to remarketing to programmatical advertising, Michael loves to keep current with technology, sharing knowledge and collaborating with other like minded digital marketers.

INTERESTED IN ACHIEVING A NEAR 100% MESSAGE OPEN RATE?

Subscribe to the 3V and learn how to achieve near 100% open rates and 40-60% click rates. How? With Facebook Messenger Chatbots Subscribers receive;

  • Free Chatbot Resources
  • How to Sell Merchandise with Chatbots
  • How to Send Broadcast Message
  • How to Create Workflows that Convert
  • How Leverage Chatbots with Facebook Ads
  • How to Combine Live Video & Chatbots

Pack Your Inbox w/Valuable Info

Facebook

Twitter

3V: BUILT IN DETROIT WITH PRIDE

Subscribe Here - Lead Generation, #SocialSelling & Digital Sales Tips

THANK YOU

FOR SENDING!

CONTACT US

CONTACT US