How to Send Emails with Your Facebook Chatbot

How to Send Emails with Your Facebook Chatbot


Facebook chatbots are quickly becoming one of the fastest-growing trends for modern marketers. If you look at the interest over time it’s been quickly rising in the past few years.

image-b08fd3bd4ab8c43ccb31f9605d22f5295073cd34-760x401-png

They can engage your customers and answer their questions, helping to keep the conversation going with virtually no effort.

The powerful automation doesn’t stop there though, chatbots now can also collect data and send it straight to your inbox.

This is useful for a wide range of things including:

  • Generating leads
  • Providing support to your customers.
  • Managing a record of customer information.
  • Centralizing all your customer communication into one place.

In this guide we’ll teach you step by step how to make a Facebook chatbot that asks a few questions to your users, and then delivers their responses to your email address.

Collecting and Emailing Feedback from Your Chatbot

Before you start this guide please make sure you have first completed our guide on how to create your Facebook chatbot. This will teach you how to set up your first chatbot and connect it so you can follow along with this tutorial.

For the purpose of this exercise, we’ve created a test chatbot with a simple welcome message, nothing fancy.

The first thing we’re going to do is add a new block, this block will collect our user’s email address and message to send to us in an email.

Start by adding a new block:

image-b925ddf19dcd1e6a3bbb85f8bdf42a875f428cb1-760x353-png

Next we’re going to give our block a descriptive name, we’ve called ours “Email Block”, and then we’ll click the plus symbol below the “add a card” section to expand the cards available for us to add to our block.

image-ac9c1e826ac49151131d639a41c993309507c413-760x353-png

For a quick reminder, cards can be a message, such as an image or text, or an action, such as sending an email or simulating typing for a second.

Select “User Input” from the list of options:

image-56c00439fdd5e7ff1a99b0b2a32381a2f6f6a479-760x353-png

Your block should now look something like this:

image-3592e896b40f1b61cc505cbe3802463598eb7c87-760x353-png

The user input card asks the user questions and saves their responses to attributes. Attributes are like storage on information about the user that you can use later.

Write your first question in the field below “message to user”, we’re going to ask the user “What is your email?”, then select “Email” from the dropdown for validation and type “email” into the field below “save answer to attribute”.

We can reference this field later using the text “{{email}}” (the double curly braces indicate to Chatfuel that you are referencing an attribute).

Once you’ve done that, click “add fields” to add our next field.

image-3592e896b40f1b61cc505cbe3802463598eb7c87-760x353-png

Fill out our next field with our message as “What is your message?”, leaving validation as “none” and set the attribute to “message” so we can reference it later with “{{message}}”.

image-df86cea845023faa23ca69a12e0697e045f188c5-760x353-png

Now we’ve got to send this information somewhere! Click the plus sign below the “add a card” section again to show our list of cards available.

image-29e8badaa968fa1e3da7504263ee4efcd52fa9cb-760x353-png

This time select “Send Email” from the list of options.

image-e9f54ab1c2a39de140c4f38c330b341a2643928e-760x353-png

You should now see an email card in your block like this:

image-a158e1c30d88f83a580205a306684f896b249316-760x353-png

The email card will send our email for us; we can set a subject line, the recipients and the contents of the email.

Give your email a good title, add your email address and past this text into the email body:

You have a new message from your Facebook chat.

Name: {{first name}} {{last name}}

Email Address: {{email}}

Message: {{message}}

image-28326a157205bb2ae1ac1b1cb955bfc37f8bef28-760x372-png

Our first line is just plain text letting them know this is a new email from our chatbot

  • Our next line puts the users first name and last name from their Facebook profile into the message using the two attributes {{first name}} and {{last name}}
  • The line after that puts the attribute we saved earlier for their email address into the body of our email using the {{email}} attribute.
  • And our final line does the same as our previous for the {{message}} attribute we recorded.

Next click the text card at the bottom to add a new text card to the block, and put a simple message in to let them know that the email was successfully sent.

image-cda6549da146eedfe688828e0c08a3b238f2bee1-760x353-png

We’ve now finished our email block, but we still have to send our users there from our welcome message. Click the “Welcome message” block on the left-side to open our welcome message block, then click “add button” below our text card.

image-609c0b76d1f01a03bdfa32252349e71b4501b5b5-760x372-png

Give your button a good label like “Get in touch” then type and select your email block to link the button to your email block.

image-6fce35da5d9a6fac1dd9755230cdcd69f07d3859-760x353-png

We’re now ready to test it! Click “test this chatbot” in the top right of your screen.

image-0236a5e57720dd4effa9cab7254d1619d4877d47-760x353-png

You should receive a message from your chatbot in Facebook Messenger that looks something like this:

image-e8793a82c792732aedf83e0b3197dcf46b428909-653x119-png

Click the button and your chatbot should ask you a few questions then send your responses to your email.

image-f12471eb4ab81f4d181cbe2e63961cccc23e92e8-760x335-png

Then if you check your email you should see a new email with your responses:

image-768a4b5deae2b22ba2c211e55baf5e8296080ff0-365x183-png

Your chatbot is now successfully asking questions and sending the answers to your email!

But there’s something we can do to make the experience for users a lot better.

Right now as soon as you click “get in touch” the chatbot will start asking questions and you can’t escape out of this loop until you’ve answered those questions, this can be jarring if they weren’t ready to start composing an email.

What we’re going to do is create a block that goes between the email and welcome block that tells the user what questions we are going to ask and gives them the opportunity to cancel out of it.

Start by creating a new block and giving it a descriptive name. Next, add a new text card to your block and write a simple message outlining what questions you will ask.

image-181ad9ab9d2424d2c9d9afee9e1622cdc9fa1c63-760x353-png

Then add a “Send Email” button that takes you to your email block.

image-d03cb89d62c5c3bfb11fcd4e6f8e7e9cbebce251-760x353-png

And add a “Send Later” button that takes you back to the welcome message.

image-512202f7e675c4ecc7a31eea8f0faaa6494d3fe9-760x353-png

Next go back to our welcome message block and replace the linked block for our button from the email block to our new block.

image-4a75109f40133c125a29e44ba46382b4a0152e2b-760x353-png

Give it a test run and you should see the chatbot ask if you’d like to continue before it starts to fire questions.

image-cdebbc2f88aa21de1ac2666823f29ce14a5f1c25-760x329-png

Congratulations! Your facebook chatbot now sends emails straight to your inbox.

Here’s a few ways you could make your chatbot even better:

  • Ask more questions to include in your email.
  • If someone clicks “Send Later”, take them to a different block that doesn’t loop them back to the welcome message.
  • Give users the option to call you instead (we covered how to do that in our first chatbot guide).

If you found reading this blog post helpful, consider subscribing to our newsletter to the right of this blog post get sent our latest posts directly, some of the next blog posts we’ll be writing includes:

  • How to create a chatbot that responds to key phrases
  • How to add your Facebook chatbot to your website
  • How to discover new leads using a chatbot