from django.conf import settings

AIDA_NOTIFICATIONS = getattr(settings, 'AIDA_NOTIFICATIONS', {})

DEFAULT_FROM_EMAIL = AIDA_NOTIFICATIONS.get('DEFAULT_FROM_EMAIL', settings.DEFAULT_FROM_EMAIL)
DEFAULT_FROM_NAME = AIDA_NOTIFICATIONS.get('DEFAULT_FROM_NAME', '')
DEFAULT_FROM_PHONE = AIDA_NOTIFICATIONS.get('DEFAULT_FROM_PHONE', '')

EMAIL_BACKEND = AIDA_NOTIFICATIONS.get('EMAIL_BACKEND', 'aida_notifications.backends.email.AnymailBackend')
SMS_BACKEND = AIDA_NOTIFICATIONS.get('SMS_BACKEND', 'aida_notifications.backends.sms.TwilioBackend')

TWILIO_ACCOUNT_SID = AIDA_NOTIFICATIONS.get('TWILIO_ACCOUNT_SID', getattr(settings, 'TWILIO_ACCOUNT_SID', ''))
TWILIO_AUTH_TOKEN = AIDA_NOTIFICATIONS.get('TWILIO_AUTH_TOKEN', getattr(settings, 'TWILIO_AUTH_TOKEN', ''))
TWILIO_FROM_NUMBER = AIDA_NOTIFICATIONS.get('TWILIO_FROM_NUMBER', getattr(settings, 'TWILIO_FROM_NUMBER', ''))
TWILIO_MESSAGING_SERVICE_SID = AIDA_NOTIFICATIONS.get('TWILIO_MESSAGING_SERVICE_SID', getattr(settings, 'TWILIO_MESSAGING_SERVICE_SID', ''))

RETRY_FAILED_NOTIFICATIONS = AIDA_NOTIFICATIONS.get('RETRY_FAILED_NOTIFICATIONS', True)
MAX_RETRY_ATTEMPTS = AIDA_NOTIFICATIONS.get('MAX_RETRY_ATTEMPTS', 3)
RETRY_DELAY_SECONDS = AIDA_NOTIFICATIONS.get('RETRY_DELAY_SECONDS', 300)

LOG_NOTIFICATIONS = AIDA_NOTIFICATIONS.get('LOG_NOTIFICATIONS', True)
ENABLE_RATE_LIMITING = AIDA_NOTIFICATIONS.get('ENABLE_RATE_LIMITING', False)
RATE_LIMIT_PER_HOUR = AIDA_NOTIFICATIONS.get('RATE_LIMIT_PER_HOUR', 100)

BATCH_SIZE = AIDA_NOTIFICATIONS.get('BATCH_SIZE', 100)
USE_CELERY = AIDA_NOTIFICATIONS.get('USE_CELERY', False)

TEST_MODE = AIDA_NOTIFICATIONS.get('TEST_MODE', False)
TEST_MODE_RECIPIENTS = AIDA_NOTIFICATIONS.get('TEST_MODE_RECIPIENTS', {
    'email': [],
    'sms': [],
})
