Setup SMTP provider
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:
| Setting | Environment Variable | Description |
|---|---|---|
| Default provider type | BOX_MODULE_PROVIDER_DEFAULT_TYPE | Set to smtp for SMTP providers |
| Default provider host | BOX_MODULE_PROVIDER_DEFAULT_HOST | SMTP server hostname (e.g., smtp.example.com) |
| Default provider port | BOX_MODULE_PROVIDER_DEFAULT_PORT | SMTP server port (e.g., 465 or 587) |
| Default provider from address | BOX_MODULE_PROVIDER_DEFAULT_FROM | Sender email address |
| Default provider username | BOX_MODULE_PROVIDER_DEFAULT_USERNAME | SMTP authentication username |
| Default provider password | BOX_MODULE_PROVIDER_DEFAULT_PASSWORD | SMTP authentication password |
| Default provider SSL | BOX_MODULE_PROVIDER_DEFAULT_SSL | Enable SSL connection (true / false) |
| Default provider TLS | BOX_MODULE_PROVIDER_DEFAULT_TLS | Enable 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-provider
providerData:
to: recipient@example.com
subject: My subject of the message
template:
id: notificationTemplateId
resourceType: NotificationTemplate
payload:
foo:
bar: zaz