CRM Agent
-
Lets build agents which can handle crm activities
- sending notifications to all students
- regarding class timings
- regarding classroom notes uploaded
- regarding video uploaded
- Adminstrivate updates
- remainders about payment dues etc (individuals)
- social media posts
- job postings to telegram channel
- sending notifications to all students
-
Students table
CREATE TABLE `students` (
`id` int NOT NULL AUTO_INCREMENT,
`qtid` varchar(100) DEFAULT NULL,
`name` varchar(100) NOT NULL,
`mobile` varchar(15) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`batchno` varchar(20) DEFAULT NULL,
`birthdate` date DEFAULT NULL,
`telegram_id` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- SELECT * FROM genaideveloper.students;
- insert statements
INSERT INTO `students` (`qtid`, `name`, `mobile`, `email`, `batchno`, `birthdate`, `telegram_id`)
VALUES ('QT123', 'Rahul Sharma', '9876543210', 'qtkhajacloud@gmail.com', 'BATCH2024', '1995-07-21', '@rahulsharma');
INSERT INTO `students` (`qtid`, `name`, `mobile`, `email`, `batchno`, `birthdate`, `telegram_id`)
VALUES ('QT124', 'Priya Patel', '8765432109', 'qtgenaikhaja@gmail.com', 'BATCH2025', '1998-03-15', '@priyapatel');
- Now lets modify the course table to include course and group telegram channel
-- This is your existing statement, commented out for reference:
-- CREATE TABLE `courses` (
-- `id` int NOT NULL AUTO_INCREMENT,
-- `course_name` varchar(50) NOT NULL,
-- PRIMARY KEY (`id`)
-- ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Here is the MODIFIED version:
CREATE TABLE IF NOT EXISTS `courses` (
`id` int NOT NULL AUTO_INCREMENT,
`course_name` varchar(50) NOT NULL,
`course_telegram_channel` varchar(100) DEFAULT NULL,
`group_telegram_channel` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Sample inserts for courses
INSERT INTO `courses` (`course_name`, `course_telegram_channel`, `group_telegram_channel`)
VALUES ('GenAI Developer', 'https://t.me/python_course', 'https://t.me/python_group');
- Lets build a graph which can send email notification or telegram notification to individual or group
Stage1: set the agent to get data from database
Lets create a agent which interacts with database and gets the telegram ids and email ids Refer Here for the changes
Stage 2: enhance the agent to send notifications to telegram and email
- Refer Here for basic structure
- Lets build a custom tool for sending emails Refer Here for official docs
- Refer Here for the changes done to add a custom email tool
Lets add telegram agent
- Register Your Telegram Bot
- Open Telegram and search for the official bot called @BotFather.
- Start a chat with BotFather and click “Start”.
- Create a new bot by typing /newbot and follow the instructions.
- Set a name and username for your bot as prompted.
- Copy the API token provided by BotFather—you’ll need this to control your bot
- To be done in next session
