Sales Agent Integration introduces a cutting-edge solution for business owners to discover potential leads with ease. By specifying their business type and target audience through a simple chat with a sales agent, users receive a curated list of relevant leads in an organized format. This streamlined process enhances customer outreach and supports business growth.
- Chat-Based Input: Business owners can provide their business type and target audience through a friendly chat interface with the sales agent on the telex platform.
- Curated Lead Generation: The sales agent retrieves a list of potential leads tailored to the specified criteria.
- Organized Output: Leads are presented in a clear and easy-to-read format.
- Custom Automation: The lead retrieval process runs automatically at a set time, ensuring business owners always have access to updated leads.
- Telex Success Notifications: Users receive success messages via the Telex channel whenever new leads are fetched.
- Sign Up: Sign up for a Telex account at Telex.
- Create an Organisation: Create an organisation on the Telex platform.
- Create a Channel: Create a channel in the organisation.
- Add the Sales Agent: Click on
Apps
, then click onAdd New
to add the Sales Agent to the channel. - Sales Agent Integration: Enter this URL
https://sales-agent-3wyf.onrender.com/integration.json
in theIntegration Json Url
field and clickSave
. - Activate the Sales Agent: Click on
the toggle button
to activate the Sales Agent in the channel. - Confugure the Sales Agent: Click on the
Manage App
button to configure the Sales Agent. - Set the Custom Channel: Click on the
Output
tab -> Custom Channels -> Add Custom Channel -> Select the channel you want to see the output. - You're all set! The Sales Agent is now active in the channel.
The chat interaction between business owners and the sales agent takes place in the telex channel and is handled by the ChatService
class which processes messages, validates inputs, and guides users through a structured flow to collect information for lead generation. Below is a breakdown of the interaction steps:
-
Starting the Process:
-
Exiting the Process:
-
Email Validation:
-
Company Information:
-
Lead Type:
-
Automated Instructions:
- Clear and friendly instructions are sent at every step of the process.
- The system communicates with users via the configured Telex webhook URL.
-
Persisting User Data:
- Once all required inputs are collected, the user's information (email, company name, and lead type) is saved in the database for further processing.
-
Domain Search Integration:
- The service triggers the
domain-search
endpoint of the lead generation API to fetch leads matching the specified criteria.
- The service triggers the
-
Success Notification:
The lead search feature is implemented in the domainSearch
method of the LeadService
class. It retrieves potential leads based on the user's specified domain and stores new, unique leads in the database. Below is an overview of its workflow:
-
Retrieve User Details:
- The
domainSearch
method starts by fetching the user's information from the database using thechannel_id
from theSalesAgentPayloadDTO
payload. - If the user is not found, an exception is thrown.
- The
-
Construct API Request:
- The method uses the domain provided by the user (
LeadType
) to construct thedomain-search
API request. - The API key and base URL for the request are configured in
OkHttpConfig
.
- The method uses the domain provided by the user (
-
Fetch and Parse Data:
- A
GET
request is sent to the Hunter.io API - The API response is parsed into a JSON object to extract relevant data, such as email addresses, names, LinkedIn URLs, company information, and industry.
- A
-
Filter Unique Leads:
- Existing leads in the database are checked to ensure no duplicates are stored.
- New leads are created only for entries with unique email addresses.
-
Save Leads and Notify:
- New leads are saved to the database.
- For each new lead, the system sends a notification to the specified
Telex channel
using theTelexClient
.
-
Log Success:
- Logs are generated to confirm how many new leads were successfully saved.