feat: add email settings management

- Introduced EmailSettings component for managing SMTP services.
- Added API endpoints for organization email services including CRUD operations.
- Created database migrations for organization_email_settings and organization_email_services tables.
- Updated the settings page to include EmailSettings component.
- Implemented validation and error handling for email service operations.
This commit is contained in:
2026-04-15 09:33:50 -04:00
parent 44facf7f4a
commit e1d5975e57
12 changed files with 1877 additions and 18 deletions
@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS organization_email_settings (
organization_id UUID PRIMARY KEY REFERENCES organizations(id) ON DELETE CASCADE,
smtp_enabled BOOLEAN NOT NULL DEFAULT FALSE,
smtp_host TEXT,
smtp_port INTEGER NOT NULL DEFAULT 587,
smtp_from TEXT,
smtp_username TEXT,
smtp_password TEXT,
smtp_starttls BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_org_email_settings_org_id ON organization_email_settings(organization_id);