Gmail Reader
import logging
from gunicorn.app.base import BaseApplication
from app_init import app
# IMPORT ALL ROUTES
from routes import *
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
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)
Created: | Last Updated:
Gmail Reader Template Guide
This template provides a starting point for building applications that need to read Gmail messages. It includes user authentication, Gmail API integration, and a simple interface for connecting and syncing emails.
Getting Started
- Click "Start with this Template" to begin using the Gmail Reader template
Initial Setup
Before testing the app, you'll need to set up Google OAuth credentials:
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Gmail API for your project
- Go to "Credentials" and click "Create Credentials" > "OAuth 2.0 Client ID"
- Select "Web application" as the application type
- Add your authorized redirect URI (you'll get this from Lazy after deployment)
- After creating, you'll receive a Client ID and Client Secret
- In the Lazy Builder, go to Environment Secrets and add:
GOOGLE_CLIENT_ID
: Your OAuth client IDGOOGLE_CLIENT_SECRET
: Your OAuth client secret
Test the Application
- Click the "Test" button to deploy the application
- Lazy will provide you with a server link to access your application
Using the App
- Visit the server link provided by Lazy
- Click "Get Started" on the landing page
- Sign in with your Google account
- On the profile page, click "Connect Gmail" to authorize the application
- Once connected, you can:
- Select how many days of emails to sync (7, 14, 30, or 90 days)
- Click "Sync Emails" to fetch your messages
The application provides a clean interface for managing your email connection and synchronization settings. The sidebar allows easy navigation and displays your profile information.
Template Benefits
- Email Analytics Integration
- Enables businesses to analyze email communication patterns
- Perfect for creating customer engagement metrics and response time analytics
-
Valuable for organizations looking to improve communication efficiency
-
Customer Service Enhancement
- Can be used to build automated ticket management systems
- Helps track and prioritize customer inquiries automatically
-
Enables faster response times and better customer satisfaction
-
Sales Pipeline Management
- Automatically tracks sales-related emails and follow-ups
- Can identify potential leads from email interactions
-
Helps sales teams manage and prioritize their email-based opportunities
-
Compliance and Audit Solutions
- Provides a foundation for email archiving and compliance monitoring
- Useful for organizations that need to maintain email records
-
Can help track and document important communications
-
Workflow Automation Platform
- Serves as a base for creating email-triggered automated workflows
- Can integrate with other business systems for seamless operations
- Reduces manual email processing and increases productivity
Technologies




