Rackspace Email Integration Overview
The MyNATCA Platform includes a comprehensive Rackspace Email integration for managing official @natca.net email addresses for eligible members. This integration provides automated provisioning, availability checking, and password management for NATCA member email accounts.
Features
Email Account Management
- Create new @natca.net email addresses for eligible members
- Check email address availability before creation
- Reset passwords for existing natca.net email accounts
- Automatic profile integration (emails stored in member emailinformation table)
Member Eligibility Controls
- Restricted to NATCA members (membertypeid=6)
- Status validation (Active or Retired members only)
- One email per member enforcement
- Integration with member profile data
Email Format Options
- First initial + Last name:
jdoss@natca.net - First name + Last name:
jason.doss@natca.net - Availability check ensures email is not already taken
- Automatic format generation based on member name
Secure Password Generation
- Auto-generated 16-character passwords
- Meets Rackspace security requirements:
- Minimum 8 characters
- At least 3 of 4 character types (uppercase, lowercase, numbers, special characters)
- Password displayed once after creation for security
- Password reset capability for existing accounts
Key Components
| Component | Purpose | Location |
|---|---|---|
| Rackspace API Client | API client with authentication and rate limiting | /sync/rackspace/lib/client.js |
| Platform API Routes | REST endpoints for email management | /routes/rackspace.js |
| Member Validation | Eligibility and profile checks | /routes/rackspace.js |
| Password Generator | Secure password generation | /sync/rackspace/lib/client.js |
| Email Formatter | Email format generation and validation | /sync/rackspace/lib/client.js |
Architecture Flow
ββββββββββββββββ Check ββββββββββββββββ
β Member Hub β Availability β Platform β
β UI β ββββββββββββββββββΆβ API β
ββββββββββββββββ ββββββββ¬ββββββββ
β
β Validate
β Eligibility
β
βΌ
ββββββββββββββββ
β Rackspace β
β Email API β
ββββββββ¬ββββββββ
β
β Create
β Mailbox
β
βΌ
ββββββββββββββββ
β MySQL β
β (emailinfo) β
ββββββββββββββββMember Eligibility
Eligible Members
- Member Type: NATCA members only (membertypeid=6)
- Status: Active or Retired
- Limit: One @natca.net email per member
Ineligible Members
- Non-NATCA members (other member types)
- Members with status other than Active or Retired
- Members who already have a @natca.net email address
Data Flow
Email Creation Process
- Member Hub initiates email creation request (requires Auth0 session)
- Platform API validates member eligibility:
- Checks membertypeid=6 (NATCA member)
- Verifies status is Active or Retired
- Confirms no existing @natca.net email in profile
- Platform API generates email format options:
- First initial + last name:
jdoss@natca.net - First name + last name:
jason.doss@natca.net
- First initial + last name:
- Platform API checks availability with Rackspace API
- Platform API creates mailbox with secure auto-generated password
- Platform API adds email to member profile in emailinformation table
- Platform API returns credentials (password shown once)
Password Reset Process
- Member Hub requests password reset for existing email
- Platform API validates member owns the email address
- Platform API generates new secure password
- Rackspace API resets mailbox password
- Platform API returns new password (shown once)
Environment Variables
The following environment variables are required for Rackspace integration:
# Rackspace Email API
RACKSPACE_API_KEY=your_rackspace_api_key
RACKSPACE_SECRET_KEY=your_rackspace_secret_key
RACKSPACE_CUSTOMER_ID=your_customer_account_number
# Supabase (for member data)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# MySQL (for email profile storage)
MYSQL_HOST=your_mysql_host
MYSQL_USER=your_mysql_user
MYSQL_PASS=your_mysql_password
MYSQL_DB=your_mysql_database
# Auth0 (for session authentication)
AUTH0_DOMAIN=natca-prod.us.auth0.com
AUTH0_CLIENT_ID=your_client_id
AUTH0_CLIENT_SECRET=your_client_secret
SESSION_SECRET=your_secure_session_secretAPI Endpoints
Interactive Documentation: The Platform API includes comprehensive Swagger/OpenAPI documentation at http://localhost:1300/api-docs (opens in a new tab) under the "Rackspace Email" tag.
Check Email Availability
POST /api/rackspace/check-availability
Authorization: Session (Auth0)
Content-Type: application/json
{
"memberNumber": "12345"
}Create Email Account
POST /api/rackspace/create-email
Authorization: Session (Auth0)
Content-Type: application/json
{
"memberNumber": "12345",
"emailFormat": "jdoss@natca.net"
}Reset Email Password
POST /api/rackspace/reset-password
Authorization: Session (Auth0)
Content-Type: application/json
{
"memberNumber": "12345",
"email": "jdoss@natca.net"
}Quick Start
Check Email Availability
const response = await fetch('/api/rackspace/check-availability', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ memberNumber: '12345' })
});
const data = await response.json();
// Returns: { availableFormats: ['jdoss@natca.net', 'jason.doss@natca.net'] }Create Email Account
const response = await fetch('/api/rackspace/create-email', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
memberNumber: '12345',
emailFormat: 'jdoss@natca.net'
})
});
const data = await response.json();
// Returns: { email: 'jdoss@natca.net', password: '...' }
// Password shown once - must be saved by userReset Password
const response = await fetch('/api/rackspace/reset-password', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
memberNumber: '12345',
email: 'jdoss@natca.net'
})
});
const data = await response.json();
// Returns: { email: 'jdoss@natca.net', newPassword: '...' }Security Features
Authentication
- All endpoints require Auth0 session authentication
- Member validation ensures users can only manage their own emails
- Service-to-service authentication for administrative operations
Password Security
- 16-character auto-generated passwords
- Mix of uppercase, lowercase, numbers, and special characters
- Passwords displayed once and never stored in Platform
- Reset capability allows users to generate new passwords
Rate Limiting
- Rackspace API client includes automatic rate limiting
- Retry logic with exponential backoff
- Error handling for API failures
Integration Points
Member Hub
- Provides user interface for email creation and management
- Displays available email formats
- Shows password once after creation
- Handles password reset workflow
Platform API
- Validates member eligibility
- Manages Rackspace API authentication
- Handles email creation and password resets
- Updates member profile with new email
MySQL Database
- Stores email addresses in emailinformation table
- Links emails to member profiles
- Tracks email creation and updates
Rackspace Email API
- External service for mailbox management
- Handles actual email account creation
- Manages password resets
- Provides availability checking
Related Documentation
- Setup & Configuration - Environment setup and Rackspace API configuration
- API Workflows - Detailed API workflows and examples
- Troubleshooting - Common issues and solutions
- Platform API Reference - Complete Platform API documentation
- Deployment Guide - Deployment procedures and environment variables
The Rackspace Email integration provides NATCA members with professional @natca.net email addresses, enhancing organizational communication and member benefits.