Communication Service Configuration
Environment Variables
Database
DATABASE_URL=postgresql://user:password@localhost:5432/communication_dev
Redis (Oban)
REDIS_URL=redis://localhost:6379
Email Configuration
# SMTP Settings
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=your-email@example.com
SMTP_PASSWORD=your-password
SMTP_TLS=true
SMTP_AUTH=true
# Email From Address
EMAIL_FROM_ADDRESS=noreply@example.com
EMAIL_FROM_NAME=1nga Platform
SMS Providers
Twilio
TWILIO_ACCOUNT_SID=your-account-sid
TWILIO_AUTH_TOKEN=your-auth-token
TWILIO_PHONE_NUMBER=+1234567890
BulkSMS.com
BULKSMS_USERNAME=your-username
BULKSMS_PASSWORD=your-password
AWS SNS
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_REGION=us-east-1
AWS_SNS_TOPIC_ARN=arn:aws:sns:region:account:topic
Push Notifications
FCM (Firebase Cloud Messaging)
FCM_SERVER_KEY=your-fcm-server-key
APNS (Apple Push Notification Service)
APNS_KEY_PATH=/path/to/apns-key.p8
APNS_KEY_ID=your-apns-key-id
APNS_TEAM_ID=your-apns-team-id
APNS_BUNDLE_ID=com.example.app
APNS_ENVIRONMENT=production # or sandbox
Service Configuration
# Service Port
PORT=8010
# Host
HOST=0.0.0.0
# Logging
LOG_LEVEL=info
# Rate Limiting
RATE_LIMIT_EMAIL=100 # per minute
RATE_LIMIT_SMS=50 # per minute
RATE_LIMIT_PUSH=200 # per minute
Configuration Files
config/config.exs
Main configuration file for the Elixir application.
config/dev.exs
Development-specific configuration.
config/prod.exs
Production configuration.
config/test.exs
Test environment configuration.
Provider Priority
SMS providers are tried in order until one succeeds:
- Twilio (primary)
- BulkSMS.com (fallback)
- AWS SNS (fallback)
Template Configuration
Email templates are stored in PostgreSQL and can be managed via the API or database directly.
Rate Limiting
Rate limits are enforced per API key/user and can be configured per channel.