How to Build an AI Sales Development Representative (SDR) in Slack - Part 4: Campaign Creation
Introduction #
In this fourth part of our AI SDR series, we'll enhance our AI sales assistant with email campaign creation capabilities. With this template and guide, your AI SDR will not only find, enrich leads with emails, and generate personalized email sequences, but also create campaigns in Smartlead, significantly boosting your sales team's efficiency and outreach effectiveness.
This guide is Part 4 of a six-part series for how to build your own AI SDR (Sales Development Representative) in Slack. This template includes the code from Parts 1-3 and the subsequent guides are linked at the bottom of this post.
Getting Started #
To begin enhancing your AI sales assistant with campaign creation and execution capabilities, fork this template by clicking "Use Template" below:
Smartlead API
For this enhanced version of our AI for lead generation and outreach, you'll need to get a Smartlead API key in the following way:
- Head to your Smartlead Profile Settings
- On the Your Profile page, you'll see a section titled Smartlead API Key
- Click the Copy button next to the key.
- Open your Replit Project to the Secrets tool. To find it, type ⌘ + K (or Ctrl + K) and search for "secrets"
- Paste in your key into the value for SMARTLEAD_API_KEY
Breaking Down the Enhanced AI Sales Assistant Code #
Let's explore the key components that make our AI SDR a more powerful tool for lead generation, qualification, email sequence generation, and campaign execution:
Smartlead Campaign Creation and Lead Upload
The create_smartlead_campaign and upload_leads_to_smartlead functions in utils.py handle the creation of campaigns and uploading of leads to Smartlead:
These functions create a new campaign in SmartLead and upload the enriched leads to that campaign.
Saving Email Sequences to Smartlead
The save_campaign_sequence function in utils.py saves the generated email sequence to the Smartlead campaign:
This function takes the generated email sequence and saves it to the Smartlead campaign, setting up the entire outreach sequence.
Executing the Campaign Creation Process
In main.py, we've updated the post_final_email_sequence function to handle the entire campaign creation and execution process:
This function orchestrates the entire process of creating a SmartLead campaign, uploading leads, saving the email sequence, and providing a summary of the created campaign to the user in Slack.
Deploying Your AI SDR #
In order to keep your AI SDR running 24/7 and receive requests whenever someone mentions it in Slack, you'll need to deploy it on a hosted server.
Open a new tab in the Workspace and search for “Deployments” or open the control console by typing ⌘ + K (or Ctrl + K) and type "deploy". You should find a screen like this.
For bots like this that need always need to be up listening to requests, we recommend using a Reserved VM. On the next screen, click Approve and configure build settings most internal bots work fine with the default machine settings but if you need more power later, you can always come back and change these settings later. You can monitor your usage and billing at any time at: replit.com/usage.
On the next screen, you’ll be able to set your primary domain and edit the Secrets that will be in your production deployment. Usually, we keep these settings as they are.
Finally, click Deploy and watch your bot go live!
What's Next for Your AI Sales Assistant #
With these enhancements, your AI SDR is now a comprehensive end-to-end tool for lead generation, email address enrichment, email sequence generation, and campaign creation.
In the next part of this series, we'll be adding the ability for the assistant to add your leads and into your HubSpot CRM. The other parts of the series include:
- AI SDR - Part 1 - Lead List Creation
- AI SDR - Part 2 - Lead Enrichment
- AI SDR - Part 3 - Draft Email Copy
- AI SDR - Part 4 (this guide) - Create Smartlead campaign
- AI SDR - Part 5 - Add Leads to HubSpot
- AI SDR - Part 6 (Final) - Agent Mode
If you'd like to discuss how to enable your team to build and implement tools like these, feel free to schedule some time with the Replit team for a quick demo of our product.
Happy coding and selling!