An automated lead follow-up notification system that sends personalized nudges to pending leads via multiple communication channels.
LeadFollow integrates with Google Sheets to manage leads and automatically sends follow-up messages through Telegram, WhatsApp (via Twilio), or WhatsApp Business API (WABA) based on scheduled follow-up dates. Perfect for sales teams, event organizers, and business development teams that need to maintain consistent contact with leads.
- Google Sheets Integration - Manage leads directly from a Google Sheets spreadsheet
- Multi-Channel Support - Send notifications via:
- Telegram
- WhatsApp (Twilio)
- WhatsApp Business API (WABA)
- Scheduled Follow-ups - Automatic nudges on specified follow-up dates
- Personalized Messages - Customizable message templates with lead information
- Status Tracking - Automatically update lead status to "Nudged" after sending
- Python 3.7+
- Google Sheets API credentials (service account JSON)
- API tokens for notification services:
- Telegram Bot Token
- Twilio Account SID and Auth Token
- WhatsApp Business API Access Token (optional)
- Clone the repository:
git clone https://github.com/CoderKarsh/LeadFollow.git
cd LeadFollow- Install dependencies:
pip install -r requirements.txt- Set up environment variables in a
.envfile:
TELEGRAM_BOT_TOKEN=your_telegram_token
TWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_token
TWILIO_WHATSAPP_NUMBER=whatsapp:+1234567890
WABA_ACCESS_TOKEN=your_waba_token
WABA_PHONE_NUMBER_ID=your_waba_phone_id- Add your Google Sheets service account credentials:
- Download your service account JSON key from Google Cloud Console
- Save it as
service_account.jsonin the project root
Create a Google Sheet named "Leads for Bot" with the following columns:
| Column | Type | Description |
|---|---|---|
| Lead Name | Text | Name of the lead |
| Organization Name | Text | Organization the lead belongs to |
| Lead Contact ID | Text | Telegram Chat ID, WhatsApp number, or WABA ID |
| Lead Platform | Text | Communication platform (telegram, twilio, waba) |
| Follow-up Date | Date | Date for the follow-up (YYYY-MM-DD format) |
| Status | Text | Current status (Pending, Nudged, etc.) |
Run the daily nudge script:
python main.py- Connects to your "Leads for Bot" Google Sheet
- Reads all lead records
- For each lead with:
- Status = "Pending"
- Follow-up Date = Today's date
- Sends a personalized follow-up message via the specified platform
- Updates the Status to "Nudged"
To run this script daily, set up a cron job (Linux/Mac):
0 9 * * * cd /path/to/LeadFollow && python main.pyOr use Windows Task Scheduler for Windows systems.
LeadFollow/
├── main.py # Main application script
├── requirements.txt # Python dependencies
├── .env # Environment variables (create locally)
├── service_account.json # Google Sheets credentials (create locally)
└── README.md # This file
- gspread - Google Sheets API client
- oauth2client - OAuth2 authentication for Google Services
- requests - HTTP library for Telegram API
- twilio - WhatsApp and SMS messaging service
- python-dotenv - Environment variable management
- Create a bot with BotFather on Telegram
- Get your bot token and add to
.env - Use Telegram Chat IDs as contact identifiers
- Set up a Twilio account and WhatsApp sandbox
- Add your Account SID, Auth Token, and WhatsApp number to
.env - Use WhatsApp phone numbers (with +country code) as contact identifiers
- Set up WhatsApp Business API through Meta
- Add your access token and phone number ID to
.env - Note: Production functionality requires full WABA setup
- The application gracefully handles errors for each notification attempt
- Failed sends print error messages but continue processing other leads
- Individual platform failures don't affect other platforms
Important:
- Never commit
.envorservice_account.jsonfiles to version control - Use
.gitignoreto exclude sensitive files (already included) - Rotate API tokens regularly
- Use environment variables for all credentials
This project is open source and available under the MIT License.
Contributions are welcome! Feel free to submit issues and pull requests.
For issues, questions, or feature requests, please open an issue on the GitHub repository.
Built by CoderKarsh