Skip to main content

Email & SMS Configuration

Tenant-specific email and SMS configuration for notification delivery.

Email

Source: src/modules/email/
Permission: MANAGE_EMAIL_CONFIG
Base path: /email-config

Endpoints

MethodEndpointDescription
POST/email-configCreate SMTP config
GET/email-configGet config (password hidden)
PATCH/email-config/:idUpdate config
DELETE/email-config/:idDelete config
POST/email-config/sendSend email
POST/email-config/testTest SMTP connection
GET/email-config/historyNotification history

Implementation

  • Uses Nodemailer with tenant-specific SMTP settings
  • Password excluded from GET responses (smtpPassword destructured out)
  • Default port 587, TLS optional
  • One config per tenant (create checks for existing)

SMS

Source: src/modules/sms/
Permission: MANAGE_SMS_CONFIG
Base path: /sms-config

Endpoints

MethodEndpointDescription
POST/sms-configCreate SMS config
GET/sms-configGet config (secrets hidden)
PATCH/sms-config/:idUpdate config
DELETE/sms-config/:idDelete config
POST/sms-config/sendSend SMS
POST/sms-config/testTest SMS delivery
GET/sms-config/historyNotification history

Providers

  • Twilio (default) — twilioAuthToken hidden from responses
  • AWS SNSawsSnsSecretKey hidden from responses

Security

danger

Sensitive fields (smtpPassword, twilioAuthToken, awsSnsSecretKey) are never returned in API responses. They are destructured out in the service layer.

Prisma Models

  • EmailConfig — SMTP settings per tenant
  • SmsConfig — SMS provider settings per tenant
  • NotificationLog — Shared delivery history
  • NotificationsModule — Orchestrates multi-channel delivery
  • WhatsappModule — Additional messaging channel