CoAI LogoCoAI.Dev
Configuration

Email & Notifications

Configure SMTP settings, email templates, and notification systems for user communication

Email & Notifications

Configure comprehensive email and notification systems to keep users informed about account activities, system updates, and important events. Proper email configuration is essential for user verification, password resets, and ongoing communication.

Overview

The notification system handles various communication channels:

  • 📧 SMTP Email: Traditional email for account and system notifications
  • 🔔 In-App Notifications: Real-time notifications within the platform
  • 📱 Push Notifications: Mobile and desktop push notifications (PWA)
  • 📨 Email Templates: Customizable templates for different scenarios
  • ⚙️ Notification Preferences: User-controlled notification settings

Essential for User Management

Email configuration is required for basic user account functions including registration verification, password resets, and important account notifications.

SMTP Configuration

Email Server Setup

Configure your email server for reliable message delivery:

Access Email Settings

Navigate to Admin PanelSystem SettingsOperationsEmail Configuration

Configure SMTP Server

Enter your email provider's SMTP settings:

  • SMTP Server: Your email provider's SMTP hostname
  • SMTP Port: Usually 465 (SSL) or 587 (TLS)
  • Sender Email: Email address for outgoing messages
  • Password: Email password or app-specific password
  • Sender Name: Display name for outgoing emails

Security Settings

Configure encryption and security:

  • Encryption Type: SSL/TLS or STARTTLS
  • Authentication: Usually required for modern email providers
  • Connection Timeout: Timeout for SMTP connections

Test Configuration

Verify your setup:

  • Use the "Send Test Email" function
  • Check email delivery and formatting
  • Verify sender name and address display correctly
  • Test different email providers as recipients

Common Email Providers

Pre-configured settings for popular email services:

Gmail SMTP Configuration

{
  "smtp_server": "smtp.gmail.com",
  "smtp_port": 587,
  "encryption": "TLS",
  "authentication": true,
  "sender_email": "your-email@gmail.com",
  "password": "your-app-password"
}

Setup Requirements:

  1. Enable 2-factor authentication on your Google account
  2. Generate an "App Password" in Google Account settings
  3. Use the app password instead of your regular password
  4. Enable "Less secure app access" if using regular password (not recommended)

Best Practices:

  • Use a dedicated Gmail account for system emails
  • Configure Gmail filters to organize sent messages
  • Monitor Gmail sending limits (500 emails/day for free accounts)

Email Domain Restrictions

Domain Whitelist Configuration

Control which email domains can register on your platform:

Use Cases:

  • Corporate Deployment: Restrict to company email domains
  • Educational Platform: Allow only .edu domains
  • Partner Platform: Limit to approved partner domains
  • Security: Prevent spam registrations from disposable email services

Configuration Options:

{
  "domain_restrictions": {
    "enabled": true,
    "whitelist_mode": true,
    "allowed_domains": [
      "company.com",
      "subsidiary.com", 
      "partner.org"
    ],
    "blocked_domains": [
      "tempmail.com",
      "10minutemail.com",
      "guerrillamail.com"
    ]
  }
}

Implementation Modes:

  • Whitelist Mode: Only allow specified domains
  • Blacklist Mode: Block specific domains but allow others
  • Mixed Mode: Combine whitelist and blacklist rules
  • Disabled: Allow all email domains (default)

Flexibility vs Security

Consider the balance between user accessibility and security when configuring domain restrictions. Too restrictive settings may prevent legitimate users from registering.

Email Templates

Template Customization

Customize email content for different scenarios:

User Account Management

Registration Welcome Email:

Subject: Welcome to {{site_name}}!
 
Hi {{user_name}},
 
Welcome to {{site_name}}! Your account has been successfully created.
 
Account Details:
- Email: {{user_email}}
- Registration Date: {{registration_date}}
- Account Type: {{account_type}}
 
Get started by exploring our AI models and features.
 
Best regards,
The {{site_name}} Team

Email Verification:

Subject: Verify Your {{site_name}} Account
 
Hi {{user_name}},
 
Please verify your email address by clicking the link below:
 
{{verification_link}}
 
This link expires in 24 hours.
 
If you didn't create this account, please ignore this email.

Password Reset:

Subject: Reset Your {{site_name}} Password
 
Hi {{user_name}},
 
You requested to reset your password. Click the link below:
 
{{reset_link}}
 
This link expires in 1 hour for security.
 
If you didn't request this, please contact support.

Template Variables

Use these variables in your email templates:

User Variables:

  • {{user_name}} - User's display name
  • {{user_email}} - User's email address
  • {{user_id}} - Unique user identifier

Account Variables:

  • {{account_type}} - User subscription tier
  • {{credits_balance}} - Current credit balance
  • {{subscription_status}} - Active subscription status

System Variables:

  • {{site_name}} - Platform name
  • {{site_url}} - Platform URL
  • {{support_email}} - Support contact email
  • {{current_date}} - Current date

Dynamic Links:

  • {{verification_link}} - Email verification URL
  • {{reset_link}} - Password reset URL
  • {{unsubscribe_link}} - Email unsubscribe URL

Notification Types

In-App Notifications

Real-time notifications within the platform:

Notification Categories:

  • Account Events: Login alerts, password changes
  • Usage Alerts: Credit low, quota exceeded
  • System Updates: New features, maintenance
  • Social: Conversation shares, mentions

Implementation Features:

{
  "in_app_notifications": {
    "enabled": true,
    "real_time": true,
    "persistence": "7_days",
    "categories": {
      "account": {"enabled": true, "priority": "high"},
      "usage": {"enabled": true, "priority": "medium"},
      "system": {"enabled": true, "priority": "low"},
      "social": {"enabled": false, "priority": "low"}
    }
  }
}

Push Notifications

Browser and mobile push notifications:

PWA Push Notifications:

  • Browser notifications for desktop users
  • Mobile notifications for PWA app users
  • Customizable notification icons and actions
  • Click-through to relevant platform sections

Configuration Requirements:

  • HTTPS-enabled domain
  • Service worker registration
  • User permission granted
  • Valid push notification certificates

Advanced Features

Email Analytics

Track email performance and engagement:

Metrics Tracking:

  • Delivery Rates: Successful email delivery percentage
  • Open Rates: How many recipients open emails
  • Click Rates: Link click-through rates
  • Bounce Rates: Failed delivery tracking
  • Unsubscribe Rates: User opt-out tracking

Performance Optimization:

  • A/B test email subject lines
  • Optimize send times for better engagement
  • Segment users for targeted communications
  • Monitor sender reputation and deliverability

Automation Rules

Automated notification triggers:

Trigger-Based Emails:

{
  "automation_rules": [
    {
      "trigger": "user_registration",
      "delay": "immediate",
      "template": "welcome_email",
      "enabled": true
    },
    {
      "trigger": "credits_below_10",
      "delay": "1_hour",
      "template": "low_credit_warning",
      "frequency": "daily_max"
    },
    {
      "trigger": "subscription_expires_in_3_days",
      "delay": "immediate",
      "template": "subscription_reminder",
      "enabled": true
    }
  ]
}

Integration Options

Connect with external communication services:

Email Service Providers:

  • SendGrid: Professional email delivery service
  • Mailchimp: Email marketing and automation
  • Constant Contact: Small business email marketing
  • Campaign Monitor: Advanced email campaigns

Notification Services:

  • Slack: Team communication integration
  • Discord: Community notifications
  • Microsoft Teams: Enterprise communication
  • Webhook: Custom notification endpoints

Troubleshooting

Common Email Issues

Email Delivery Problems

Problem: Emails not being delivered or going to spam

Solutions:

  1. Verify SMTP configuration and credentials
  2. Check sender domain reputation and SPF/DKIM records
  3. Use professional email service providers
  4. Avoid spam-triggering words in subject lines
  5. Implement proper email authentication (SPF, DKIM, DMARC)
  6. Monitor bounce rates and clean email lists regularly

Authentication Issues

SMTP Connection Failures:

  • Verify server hostname and port settings
  • Check firewall and network connectivity
  • Ensure correct authentication credentials
  • Test with email provider's diagnostic tools

App Password Requirements:

  • Generate app-specific passwords for Gmail/Outlook
  • Enable 2-factor authentication as required
  • Use OAuth 2.0 for enhanced security where available

Delivery Optimization

Improve Email Deliverability:

  • Use consistent sender names and addresses
  • Maintain clean, engaged email lists
  • Follow email marketing best practices
  • Monitor feedback loops and blacklists
  • Implement proper unsubscribe mechanisms

Effective email and notification systems keep users engaged and informed. Continue with Security & Content Moderation for platform safety features, or explore Analytics & Monitoring to track communication effectiveness.