MessageBird SMS

SMS messaging via the MessageBird (Bird) API. Used for two-factor authentication, appointment reminders, and portal notifications.

Architecture

ComponentPath
SMS clientbackend/src/lib/sms/
Notification servicebackend/src/services/notification-service.ts

Configuration

SecretPurpose
BIRD_API_KEYMessageBird API authentication
SMS_CATCH_ALL_PHONE_NUMBERSTest safety redirect (non-production)

Secrets stored as GitHub Environment Secrets, synced to Fly.io. See Deployment Pipeline.

SMS Types

CategoryTriggerRelated Feature
2FA verification codeUser enables phone 2FAAuthentication
Appointment reminderUpcoming appointmentAppointments
Portal notificationDocument request or updatePortal, Document Obtaining
Status updateProject milestone reachedProjects

Test Safety

In non-production environments, the SMS_CATCH_ALL_PHONE_NUMBERS environment variable redirects all SMS to designated test phone numbers. This prevents accidentally sending SMS to real customers during development and staging.

EnvironmentBehavior
DevelopmentAll SMS redirected to catch-all numbers
StagingAll SMS redirected to catch-all numbers
ProductionSMS sent to actual recipient numbers

Background Processing

SMS messages are sent asynchronously via the notification queue:

  1. Service enqueues SMS job with recipient + message
  2. Background Jobs processor sends via MessageBird API
  3. Delivery status is tracked and logged

This pattern is shared with Resend Email — both use the same notification queue infrastructure.

Phone Number Handling

Phone numbers are stored in E.164 format (+49123456789). The SMS client validates format before sending. Invalid numbers are rejected with a descriptive error logged to Sentry.