Environment variables are configurable for Directus Enterprise Cloud projects via our Customer Success team. You can also set environment variables in self-hosted projects.
Email Transport
| Variable | Description | Default Value |
|---|---|---|
EMAIL_VERIFY_SETUP | Check if email setup is properly configured. | true |
EMAIL_TRANSPORT | What to use to send emails. One of sendmail, smtp, mailgun, ses, mailtrap. | sendmail |
Based on the EMAIL_TRANSPORT used, you must also provide additional variables.
Sendmail
| Variable | Description | Default Value |
|---|---|---|
EMAIL_SENDMAIL_NEW_LINE | What new line style to use in sendmail. | unix |
EMAIL_SENDMAIL_PATH | Path to your sendmail executable. | /usr/sbin/sendmail |
SMTP
| Variable | Description | Default Value |
|---|---|---|
EMAIL_SMTP_HOST | SMTP server host. | |
EMAIL_SMTP_PORT | SMTP server port. | |
EMAIL_SMTP_USER | SMTP user. | |
EMAIL_SMTP_PASSWORD | SMTP password. | |
EMAIL_SMTP_POOL | Use SMTP pooling. | |
EMAIL_SMTP_SECURE | Enable TLS. | |
EMAIL_SMTP_IGNORE_TLS | Ignore TLS. | |
EMAIL_SMTP_NAME | SMTP client hostname. |
Mailgun
| Variable | Description | Default Value |
|---|---|---|
EMAIL_MAILGUN_API_KEY | Your Mailgun API key. | |
EMAIL_MAILGUN_DOMAIN | A domain from your Mailgun account. | |
EMAIL_MAILGUN_HOST | Specify a custom host. | api.mailgun.net |
AWS SES
| Variable | Description | Default Value |
|---|---|---|
EMAIL_SES_CREDENTIALS__ACCESS_KEY_ID | Your AWS SES access key ID. | |
EMAIL_SES_CREDENTIALS__SECRET_ACCESS_KEY | Your AWS SES secret key. | |
EMAIL_SES_REGION | Your AWS SES region. |
Mailtrap
Directus sends through the official mailtrap package, which supports live sending, the sandbox testing inbox, and the bulk stream.
| Variable | Description | Default Value |
|---|---|---|
EMAIL_MAILTRAP_TOKEN | An API token from your Mailtrap account. Required. | |
EMAIL_MAILTRAP_SANDBOX | Send to a testing inbox instead of real recipients. Requires EMAIL_MAILTRAP_TEST_INBOX_ID. | false |
EMAIL_MAILTRAP_TEST_INBOX_ID | The testing inbox to send to when EMAIL_MAILTRAP_SANDBOX is enabled. | |
EMAIL_MAILTRAP_BULK | Send through the bulk stream. Cannot be combined with EMAIL_MAILTRAP_SANDBOX. | false |
EMAIL_MAILTRAP_TOKEN is required. Directus throws an error when it creates the transport without a token, because the Mailtrap transport cannot verify its configuration ahead of the first send.
Email Templates
Templates can be used to add custom templates for your emails, or to override the system emails used for things like resetting a password or inviting a user.
| Variable | Description | Default Value |
|---|---|---|
EMAIL_FROM | Email address from which emails are sent. | no-reply@example.com |
EMAIL_TEMPLATES_PATH | Where custom templates are located | ./templates |
In the EMAIL_TEMPLATES_PATH, you can create templates for your emails by adding .liquid files.
Overriding System Emails
There are a number of templates provided by Directus that can be overridden with a custom template:
| Template | File |
|---|---|
| Password Reset | password-reset.liquid |
| User Invitation | user-invitation.liquid |
| User Registration | user-registration.liquid |
When overriding the default email templates, make sure to include the provided url somewhere to ensure the email is functional.
Email Rate Limiting
Emails can be rate limited by opting in to our email rate limiters
Get once-a-month release notes & real‑world code tips...no fluff. 🐰