Aidbox allows you to configure SMTP email provider to manage your email communications.

To enable SMTP please specify optional environment variable BOX_WEB_BASE_URLL.

Configuring Mailgun

See Configuring Mailgun Integration Tutorial.

Configuring Postmark

See Configuring Postmark Tutorial.

Configuring other SMTP providers

Firstly, get your credentials from your provider:

  • host
  • port
  • from
  • username
  • password

Then, configure your SMTP provider using Aidbox settings/environment variables:

SettingEnvironment VariableDescription
Default provider typeBOX_MODULE_PROVIDER_DEFAULT_TYPESet to smtp for SMTP providers
Default provider hostBOX_MODULE_PROVIDER_DEFAULT_HOSTSMTP server hostname (e.g., smtp.example.com)
Default provider portBOX_MODULE_PROVIDER_DEFAULT_PORTSMTP server port (e.g., 465 or 587)
Default provider from addressBOX_MODULE_PROVIDER_DEFAULT_FROMSender email address
Default provider usernameBOX_MODULE_PROVIDER_DEFAULT_USERNAMESMTP authentication username
Default provider passwordBOX_MODULE_PROVIDER_DEFAULT_PASSWORDSMTP authentication password
Default provider SSLBOX_MODULE_PROVIDER_DEFAULT_SSLEnable SSL connection (true / false)
Default provider TLSBOX_MODULE_PROVIDER_DEFAULT_TLSEnable TLS connection (true / false)

Example configuration

BOX_MODULE_PROVIDER_DEFAULT_TYPE: smtp
BOX_MODULE_PROVIDER_DEFAULT_HOST: smtp.example.com
BOX_MODULE_PROVIDER_DEFAULT_PORT: 465
BOX_MODULE_PROVIDER_DEFAULT_FROM: user@example.com
BOX_MODULE_PROVIDER_DEFAULT_USERNAME: user@example.com
BOX_MODULE_PROVIDER_DEFAULT_PASSWORD: password
BOX_MODULE_PROVIDER_DEFAULT_TLS: true

Sending notifications

To send an email notification, create a Notification resource:

PUT /Notification/notification-1

provider: smtp
providerData:
  to: recipient@example.com
  subject: My subject of the message
  template:
    id: notificationTemplateId
    resourceType: NotificationTemplate
  payload:
    foo:
      bar: zaz

Last updated: