Gmail Integration #
OAuth Connection and Setup #
Corcava provides seamless Gmail integration through Google OAuth authentication:
Gmail Connection Process:
1. OAuth Authorization: Initiate connection through Google OAuth flow 2. Permission Grant: Grant necessary permissions for email access and sending 3. Token Management: Secure storage of access and refresh tokens 4. Account Verification: Verify email account ownership and validity 5. Integration Confirmation: Receive confirmation of successful Gmail connection
OAuth Configuration:
- Access Type: Offline access for continuous email functionality
- Account Selection: Prompt for account selection during authentication
- Consent Flow: Full consent flow ensuring proper permission grants
- State Management: Secure state parameter handling for callback validation
- Gmail Compose: Permission to compose and create email messages
- Gmail Send: Permission to send emails through connected Gmail account
- Gmail Read Only: Permission to read incoming emails for synchronization
- Calendar Events: Permission to manage calendar events (for meeting integration)
- Calendar Read Only: Permission to read calendar information
- Message Creation: Create properly formatted Gmail messages with HTML content
- Subject Encoding: UTF-8 base64 encoding for international subject lines
- MIME Formatting: Proper MIME-Version and Content-Type headers for email compatibility
- Message Transmission: Send emails through Gmail API with proper authentication
- HTML Content Support: Full HTML email content with rich formatting
- Character Encoding: UTF-8 encoding for international character support
- Email Headers: Proper From, To, Subject, and MIME headers
- Content Transfer Encoding: Quoted-printable encoding for reliable delivery
- Access Token Validation: Automatic validation of access token expiry
- Refresh Token Handling: Automatic token refresh when access tokens expire
- Token Updates: Seamless token updates without user intervention
- Error Handling: Comprehensive error handling for expired or invalid tokens
- Team-Based Management: Gmail accounts are organized by team for proper access control
- User Association: Each Gmail account is associated with a specific user
- Multiple Account Support: Users can connect multiple Gmail accounts
- Provider Identification: Clear identification of Google as the email provider
- Secure Token Storage: Access and refresh tokens stored securely
- Email Address Recording: Connected Gmail addresses stored for identification
- Account Status Tracking: Monitor account connection status and validity
- Error State Management: Track and manage token expiration and error states
- Provider Selection: Microsoft provider identification and configuration
- Account Prompt: Select account prompt for multi-account scenarios
- Response Type: Authorization code flow for secure token exchange
- Offline Access: Offline access for continuous functionality
- Offline Access: Permission for offline token refresh capabilities
- User.Read: Permission to read basic user profile information
- Mail.Read: Permission to read emails from connected Microsoft account
- Mail.Send: Permission to send emails through Microsoft Graph API
- Calendars.ReadWrite: Permission to manage calendar events and meetings
- Stateless Authentication: Stateless OAuth flow for secure authentication
- User Information Extraction: Extract email and user information from Microsoft response
- Account Storage: Store access tokens, refresh tokens, and email addresses
- Team Association: Associate Microsoft accounts with appropriate teams and users
- Provider Identification: Clear identification of Microsoft as email provider
- Account Display: Proper display names and identification for Microsoft accounts
- Token Management: Secure storage and management of Microsoft authentication tokens
- Error Handling: Comprehensive error logging and handling for Microsoft authentication
- Provider Diversity: Support for both Google and Microsoft email providers
- Team Organization: Email accounts organized by team with proper access control
- User Assignment: Each email account associated with specific users
- Account Identification: Clear identification of account providers and email addresses
- Account Creation: Easy creation of new email account connections
- Account Updates: Update existing account credentials and tokens
- Account Refresh: Refresh expired tokens for continued functionality
- Account Display: User-friendly display of connected email accounts
- Google Integration: Full Google/Gmail account management capabilities
- Microsoft Integration: Complete Microsoft/Outlook account management
- Provider Selection: Easy selection between supported email providers
- Unified Interface: Consistent interface regardless of email provider
- Token Encryption: Secure storage of access and refresh tokens
- Team Isolation: Email accounts isolated by team for security
- User Association: Accounts properly associated with authorized users
- Provider Tracking: Clear tracking of email provider for each account
- Token Validation: Regular validation of stored authentication tokens
- Expiry Management: Automatic handling of token expiration
- Error State Tracking: Track and manage account error states
- Connection Status: Monitor connection status for all email accounts
- API Integration: Send emails directly through Gmail API
- Authentication: Use stored access tokens for authenticated sending
- Message Formatting: Proper message formatting for Gmail compatibility
- Delivery Confirmation: Receive confirmation of successful email delivery
- Account Selection: Select from available connected email accounts
- Message Preparation: Prepare messages with proper formatting and headers
- Authentication: Authenticate using stored account credentials
- Delivery Tracking: Track email sending status and results
- HTML Content: Support for rich HTML email content
- Subject Handling: Proper subject line encoding and formatting
- Recipient Management: Handle single and multiple recipients
- Error Handling: Comprehensive error handling for sending failures
- Status States: Track email status (sent, failed, queued, draft)
- Delivery Confirmation: Record successful email delivery
- Error Logging: Log and track email sending errors
- Status Updates: Real-time status updates for outgoing emails
- UserMailbox Association: Link outgoing emails to specific connected accounts
- Recipient Tracking: Track email recipients and delivery addresses
- Subject Recording: Record email subjects for reference and tracking
- Content Management: Manage email content and formatting
- Scheduled Processing: Regular retrieval of incoming emails from connected accounts
- Contact Matching: Match incoming emails to existing contacts in the system
- Duplicate Prevention: Prevent duplicate email processing and storage
- Message Extraction: Extract email subject, content, and metadata
- Contact Association: Associate incoming emails with specific contacts
- Activity Type: Record emails as contact activities with proper typing
- Timeline Integration: Include emails in contact activity timeline
- User Attribution: Associate email activities with appropriate users
- Subject Tracking: Record email subjects for activity reference
- Message Content: Store email message content for review
- Contact Linking: Direct links between emails and contact records
- Activity History: Complete history of email communications per contact
- Unified Communication: All email communications centralized in contact records
- Activity Timeline: Chronological timeline of all contact interactions
- Team Visibility: Team-wide visibility into email communications
- Contact Context: Full context of email communications for each contact
Required Permissions:
Gmail API Functionality #
Gmail integration leverages Google’s Gmail API for comprehensive email management:
Email Sending Capabilities:
Message Formatting:
Token Management:
Gmail Account Management #
Gmail accounts are managed efficiently within team structures:
Account Organization:
Account Storage:
Microsoft/Outlook Integration #
Microsoft Graph API Connection #
Corcava supports Microsoft 365 and Outlook integration through Microsoft Graph API:
Microsoft Connection Process:
1. OAuth Redirect: Redirect to Microsoft OAuth authorization endpoint 2. Scope Authorization: Request necessary permissions for email and calendar access 3. Account Selection: Prompt for Microsoft account selection 4. Token Exchange: Exchange authorization code for access and refresh tokens 5. Account Creation: Create UserMailbox record with Microsoft credentials
Microsoft OAuth Configuration:
Required Microsoft Scopes:
Microsoft Account Management #
Microsoft accounts are integrated seamlessly with the platform:
Account Integration:
Microsoft Provider Support:
Email Account Management #
Managing Multiple Connected Accounts #
Corcava supports multiple email account connections per user and team:
Multi-Account Support:
Account Management Features:
Provider Management:
Email Account Storage and Security #
Email accounts are stored securely with comprehensive security measures:
Secure Storage:
Account Validation:
Email Sending #
Sending Through Connected Accounts #
Connected email accounts enable direct email sending through external providers:
Gmail Sending:
Sending Process:
Email Composition:
Outgoing Email Management #
Outgoing emails are tracked and managed comprehensively:
Email Status Tracking:
Outgoing Email Features:
Email Synchronization #
Incoming Email Processing #
Corcava automatically processes incoming emails from connected accounts:
Automatic Email Retrieval:
Email Processing Workflow:
1. Account Scanning: Scan connected Gmail accounts for new messages 2. Contact Identification: Identify emails from known contacts 3. Duplicate Check: Check for existing emails to prevent duplicates 4. Activity Creation: Create contact activity records for new emails 5. Email Storage: Store incoming email details and content
Contact Activity Integration #
Incoming emails are integrated with contact activity tracking:
Activity Recording:
Email Activity Features:
Synchronization Benefits: