Email AI Agent w/ Dashboard by Lazy AI
import logging
from gunicorn.app.base import BaseApplication
from app_init import create_initialized_flask_app
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()
class StandaloneApplication(BaseApplication):
def __init__(self, app, options=None):
self.application = app
self.options = options or {}
super().__init__()
def load_config(self):
# Apply configuration to Gunicorn
for key, value in self.options.items():
if key in self.cfg.settings and value is not None:
self.cfg.set(key.lower(), value)
def load(self):
Created: | Last Updated:
Here's a step-by-step guide for using the Email AI Agent with Dashboard template:
Introduction
The Email AI Agent with Dashboard template provides a powerful tool for managing automated email campaigns using AI. This template includes user authentication, email configuration, LLM model selection, email scheduling, and API integration. It's perfect for businesses looking to streamline their email outreach and follow-up processes.
Getting Started
To begin using this template:
- Click the "Start with this Template" button in the Lazy Builder interface.
Setting Up the Environment
This template requires no additional environment variables to be set up. All necessary configurations will be handled through the user interface.
Testing the Application
To deploy and test the application:
- Click the "Test" button in the Lazy Builder interface.
- Wait for the deployment process to complete. The Lazy CLI will provide you with a dedicated server link to access your dashboard.
Using the Dashboard
Once the application is deployed, you can access the dashboard using the provided link. Here's how to use the main features:
Login
- On the login page, enter your email address.
- Click "Login" to access the dashboard.
Email Settings Configuration
- Navigate to the "Settings" page from the sidebar.
- Fill in the following SMTP and IMAP details:
- SMTP Host (e.g., smtp.gmail.com)
- SMTP Port (e.g., 587)
- SMTP Username (your email address)
- SMTP Password (use an app password for Gmail)
- IMAP Host (e.g., imap.gmail.com)
- IMAP Port (e.g., 993)
- IMAP Username (your email address)
- IMAP Password (use an app password for Gmail)
- Select your preferred default LLM model.
- Click "Save Settings" to store your configuration.
Creating Contact Collections
- Go to the "Contacts" page from the sidebar.
- Click "Create a New Contact Collection" and provide a name and description.
- Add contacts to your collection by filling in their details (name, email, company, etc.).
Setting Up Campaigns
- Navigate to the "Campaigns" page from the sidebar.
- Click "Create a New Campaign" and fill in the following details:
- Title
- Prompt (instructions for the AI to generate emails)
- LLM Model
- Follow-up frequency
- Maximum number of messages
- Select a contact collection
- Choose whether to activate the campaign immediately.
Monitoring Sent Emails
- Go to the "Sent Emails" page to view the status of your email campaigns.
- Click on individual emails to see the full conversation history.
API Integration
To integrate this Email AI Agent with external systems:
- Navigate to the "Use API" page from the sidebar.
- Click "Generate API Key" to create your unique API key.
- Select a contact collection from the dropdown menu.
- Use the generated cURL command to add contacts to your collection via API.
Example API request:
bash
curl -X POST "https://your-server-link.lazy.com/api/add_contact?apikey=YOUR_API_KEY&collection_id=COLLECTION_ID&name=John%20Doe&email=johndoe%40example.com"
Replace YOUR_API_KEY
, COLLECTION_ID
, and the contact details as needed.
By following these steps, you'll have a fully functional Email AI Agent with a dashboard to manage your automated email campaigns. The system will handle follow-ups, track responses, and allow you to integrate with other tools via the API.
Here are 5 key business benefits of this Email AI Agent template:
Template Benefits
-
Automated Email Outreach: Enables businesses to set up and manage automated email campaigns powered by AI, allowing for personalized outreach at scale without manual effort.
-
Intelligent Follow-ups: The system automatically sends follow-up emails based on customizable schedules and stops upon receiving replies, optimizing engagement while avoiding spam.
-
Centralized Contact Management: Provides a dashboard to organize contacts into collections and manage campaign targeting, improving segmentation and personalization capabilities.
-
Flexible AI Model Integration: Allows selection of different LLM models (e.g. GPT-4, Claude, Gemini) for email generation, enabling businesses to leverage the latest AI advancements.
-
API Access for Integration: Includes an API for adding contacts programmatically, facilitating integration with other business systems like CRMs to create a seamless workflow.