Real-time lead alerts

When a lead comes in, it’s important to respond quickly. With Twilio, you can easily set up real-time lead notifications via SMS, email, WhatsApp, or voice so you never miss a sales opportunity.

Real estate agent receiving a lead alert SMS of a business opportunity for a new house bid.

How lead alerts work with Twilio

Integrate Twilio APIs with your web server stack, apps, and
customer data platform for simplified lead management.

Step 1
Set up your lead generation landing page

Create a landing page with a functional form that triggers automated website lead generation and sends real-time notifications via email, SMS, or WhatsApp.

Step 2
Integrate with your CRM

Connect the lead data to your customer relationship management (CRM) platform for lead capture, storage, and access to important contact information.

Step 3
Set up Twilio APIs

Set up Twilio APIs to route leads from your contact page to the right phone number or email address. Transmit lead data such as name, phone number, and inquiry information.

Step 4
Get alerts when new leads come in

Send new sales leads to your team via an an SMS, WhatsApp, or email notification with all the information they need to follow up on the lead.

Step 5
Follow up with leads

Agents can follow up with their new leads on the best channel for communication.

Diagram of how lead alerts work with Twilio, integrating Twilio API with your CRM and setting it up with a functional form to send the lead alerts via email, SMS or WhatsApp.

Twilio products for building lead alerts

Build lead alerts into any channel. Deploy your solution in hours.

  • Twilio Programmable Messaging logo

    Send lead alerts through text and MMS messages that contain customized data about the lead.

  • Twilio WhatsApp Business API logo

    Receive and respond to new leads over WhatsApp messages for convenient engagement.

  • Envelope

    Send real-time lead alerts to one or more recipients with detailed information on the inquiry.

  • Twilio Programmable Voice logo

    Deliver lead alerts with an automated outbound call when phone calls are preferred.

  • Twilio Task Router logo

    Intelligently route leads to the right agent or sales rep based on skills, location, and availability.

Get started with Twilio lead alerts in minutes

Sign up for a free Twilio account today. Use our extensive developer tools to build a custom solution supported by Twilio's best-in-class communications APIs and never miss a website lead again.

from lead_alerts import app
from flask import flash, redirect, render_template, request
from twilio.base.exceptions import TwilioRestException

from .services.twilio_service import TwilioService

def index():
    house = {
                'title': '555 Sunnybrook Lane',
                'price': '$349,999',
                    'You and your family will love this charming home. ' +
                    'Featuring granite appliances, stainless steel windows, and ' +
                    'high efficiency dual mud rooms, this joint is loaded to the max. ' +
                    'Motivated sellers have priced for a quick sale, act now!'
    return render_template('index.html', house=house)

@app.route('/notifications', methods=['POST'])
def create():
    house_title = request.form["house_title"]
    name = request.form["name"]
    phone = request.form["phone"]
    message = request.form["message"]

    twilio_service = TwilioService()

    formatted_message = build_message(house_title, name, phone, message)
        flash('Thanks! An agent will be contacting you shortly', 'success')
    except TwilioRestException as e:
        flash('Oops! There was an error. Please try again.', 'danger')

    return redirect('/')

def build_message(house_title, name, phone, message):
    template = 'New lead received for {}. Call {} at {}. Message {}'
    return template.format(house_title, name, phone, message)
using System.Web.Mvc;
using LeadAlerts.Web.Domain;
using LeadAlerts.Web.ViewModels;
using Vereyon.Web;
using System.Threading.Tasks;

namespace LeadAlerts.Web.Controllers
    public class NotificationsController : Controller
        private readonly INotificationService _notificationService;

        public NotificationsController() : this(new NotificationService()) { }

        public NotificationsController(INotificationService notificationService)
            _notificationService = notificationService;

        // POST: Notifications/Create
        public async Task<ActionResult> Create(Lead lead)
            var message = await _notificationService.SendAsync(FormatMessage(lead));

            if (message.ErrorCode.HasValue)
                FlashMessage.Danger("Oops! There was an error. Please try again.");
                FlashMessage.Confirmation("Thanks! An agent will be contacting you shortly.");

            return RedirectToAction("Index", "Home");

        private static string FormatMessage(Lead lead)
            return $"New lead received for {lead.HouseTitle}. Call {lead.Name} at {lead.Phone}. Message: {lead.Message}";

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Twilio\Rest\Client;

class NotificationsController extends Controller
    protected $client;

    public function __construct(Client $client)
        $this->client = $client;

    public function create(Request $request)
        $houseTitle = $request->input('houseTitle');
        $name       = $request->input('name');
        $phone      = $request->input('phone');
        $message    = $request->input('message');

        $formattedMessage = $this->formatMessage($houseTitle, $name, $phone, $message);

        try {
                ->flash('success', 'Thanks! An agent will be contacting you shortly.');
        } catch (Exception $e) {
            echo $e->getMessage();
                ->flash('error', 'Oops! There was an error. Please try again.');

        return redirect()->route('home');

    private function sendMessage($message)
        $twilioPhoneNumber = config('services.twilio')['twilioPhoneNumber'];
        $agentPhoneNumber = config('services.twilio')['agentPhoneNumber'];
                'from' => $twilioPhoneNumber,
                'body' => $message

    private function formatMessage($houseTitle, $name, $phone, $message)
            "New lead received for $houseTitle. " .
            "Call $name at $phone. " .
            "Message: $message";
# frozen_string_literal: true

require 'message_sender'
class NotificationsController < ApplicationController
  def create
    redirect_to root_url,
      success: 'Thanks! An agent will be contacting you shortly.'
  rescue Twilio::REST::TwilioError => error
    p error.message
    redirect_to root_url,
      error: 'Oops! There was an error. Please try again.'


  def message
    "New lead received for #{params[:house_title]}. " \
    "Call #{params[:name]} at #{params[:phone]}. " \
    "Message: #{params[:message]}"
package com.twilio.leadalerts;

import com.twilio.leadalerts.lib.MessageSender;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class NotificationsServlet extends HttpServlet {

    private final MessageSender messageSender;

    public NotificationsServlet() {
        this(new MessageSender());

    public NotificationsServlet(MessageSender messageSender) {
        this.messageSender = messageSender;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        String houseTitle = request.getParameter("houseTitle");
        String name = request.getParameter("name");
        String phone = request.getParameter("phone");
        String message = request.getParameter("message");

        String formattedMessage = formatMessage(houseTitle, name, phone, message);
        try {
            request.setAttribute("success", "Thanks! An agent will be contacting you shortly.");
        } catch (Exception e) {
            request.setAttribute("error", "Oops! There was an error. Please try again.");

        request.getRequestDispatcher("home.jsp").forward(request, response);

    private String formatMessage(String houseTitle, String name, String phone, String message) {
        return String.format("New lead received for %s. Call %s at %s. Message: %s",
                houseTitle, name, phone, message);
const Twilio = require('twilio');
const config = require('../config');
const Express = require('express');

// Some hard-coded information about a house
var house = {
    title: '555 Sunnybrook Lane',
    price: '$349,999',
    description: 'You and your family will love this charming home. '
        + 'Featuring granite appliances, stainless steel windows, and '
        + 'high efficiency dual mud rooms, this joint is loaded to the max. '
        + 'Motivated sellers have priced for a quick sale, act now!'

// Map routes to controller functions
module.exports = function () {
    // Create an authenticated Twilio API client
    var client = new Twilio(config.accountSid, config.authToken);
    const router = Express.Router();

    // Render landing page
    router.get('/', function(request, response) {
        response.render('index', house);

    // Send lead notification'/leads', function(request, response) {
        // Assemble a text message body
        var message = 'New lead received for ' + house.title + '. Call '
            + + ' at ' + + '. Message: "'
            + request.body.message + '"';

        // Send lead notification to agent
            to: config.agentNumber,
            from: config.twilioNumber,
            body: message
        .then(() => {
          // Otherwise, respond with 200 OK
          response.status(200).send('Lead notification was successfully sent.');
        .catch((err) => {

    return router;

Instant lead alerts with Python and Flask

Use Twilio Programmable SMS to send a message when a new lead is found for a Python and Flask application.

Create a landing page lead notification app with Twilio SMS API and PHP

Build a landing page with a fully functional PHP form that sends a “you’ve got a new lead” notification via email and SMS for greater convenience.

Programmable Messaging onboarding guide

Set up the Programmable Messaging API so you can deliver automated text messages when you get a new lead.

Prefer not to code? No problem.

Work with one of our trusted partners to get coding support or explore a pre-built marketing and sales solution.

Work with Twilio Professional Services to set up global call tracking for your company

Why choose Twilio for lead alerts

Twilio APIs support fast, reliable delivery of lead notifications and integrate seamlessly with your tech stack.

Build lead alerts with Twilio to handle multichannel notifications, increase conversion rates, respond to leads from anywhere and intelligently escalate hot leads.

Related use cases

Explore other use cases you can build with Twilio

Marketing and promotions

Integrate email, SMS, MMS, WhatsApp, or Voice into your existing marketing tech stack for increased conversions and customer lifetime value.

User verification and identity

Add two-factor authentication to your onboarding and login flows to keep customer accounts secure and prevent fraud.

Alerts and notifications

Inform, engage, and drive customers to take action with multichannel alerts and notifications.