You probably already have landing pages or product detail views which you're using to generate some excellent leads for your business. Would you like to let the sales team know when you've got a new qualified lead?
In this tutorial, we'll use Twilio Programmable SMS with Java and Servlets to send a message when a new lead is found. In this example, we'll be implementing instant lead alerts for a fictional real estate agency.
We'll create a landing page for a new house on the market and a form for web surfers to request additional information. The form will trigger notifications to our agents in the field, who can follow up and hopefully close the deal.
Let's see how it works! Click the button below to begin.
To display a landing page for the house, we need to have some information to show the user. For demonstration purposes, we've hard-coded the information we'd like to show.
Now we have a method to serve the house data.
Next up, let's see how to use this data to render the Landing Page.
In our landing page we'll insert the data about the house. We'll also add a sidebar form for the user to enter in their contact information and request additional information.
Our landing page template is ready (and looks great).
Now let's see how to initialize the Twilio REST Client to send messages.
Our Twilio Client is now ready to send messages! Next up, let's see how to handle incoming leads.
This code handles the HTTP
POST request from our landing page when a browser expresses interest through our form.
It uses our
MessageSender class to send an SMS message to the real estate agent's phone number, which is stored as an environment variable. We include the lead's name, phone number, and inquiry directly in the body of the text message we send to the agent.
Now the agent has all the information he or she needs to quickly follow up with the new lead.
That's a wrap! We've just implemented an application to instantly route leads to salespeople using text messages.
On the next page, we'll point out a few other useful features that are perfect for your application.
Java and Twilio go oh so well together. We'll prove it; here are a couple of our favorite Java tutorials:
Click-to-call enables your company to convert web traffic into phone calls with the click of a button.
Easily route callers to the right people and information with an IVR (interactive voice response) system.
Thanks for checking out this tutorial... tweet @twilio to let us know what you're building!