Mailer settings - configuration guide
A single guide to configure the mailer used for BREVO or SMTP providers
At a glance
- One configuration per tenant.
PUT /v1/settings/mailerreplaces the whole configuration.PATCH /v1/settings/mailerupdates a subset of fields.- Supported providers: BREVO and SMTP (SMTP currently supports
BASIC_AUTH).
🟦 BREVO configuration
Minimum fields
sender- From emailsenderName- From display nameconfiguration.provider=BREVOconfiguration.apiKey- your Brevo API key
(Note: the current PUT contract also expects a root-level apiKey. Mirror the same value there.)
Request - PUT (full)
PUT /v1/settings/mailer
Content-Type: application/json
{
"sender": "[email protected]",
"senderName": "Djust Commerce",
"apiKey": "YOUR_BREVO_API_KEY",
"configuration": {
"provider": "BREVO",
"apiKey": "YOUR_BREVO_API_KEY"
}
}Request - PATCH (rotate key only)
PATCH /v1/settings/mailer
Content-Type: application/json
{
"configuration": {
"provider": "BREVO",
"apiKey": "NEW_BREVO_API_KEY"
}
}🟧 SMTP configuration
Minimum fields
sender- From emailsenderName- From display nameconfiguration.provider=SMTPconfiguration.host- Your SMTP server hostconfiguration.port- Your SMTP server portconfiguration.username- Your SMTP server login usernameconfiguration.password- Your SMTP server login passwordconfiguration.authType=BASIC_AUTH(currently supported mode)
Note: the PUT contract still requires a root-level apiKey, which is not used by SMTP. Provide a harmless placeholder.
Request - PUT (full)
PUT /v1/settings/mailer
Content-Type: application/json
{
"sender": "[email protected]",
"senderName": "Support Team",
"apiKey": "ignored-for-smtp",
"configuration": {
"provider": "SMTP",
"host": "smtp.example.com",
"port": 587,
"username": "smtp-user",
"password": "smtp-password",
"authType": "BASIC_AUTH"
}
}Request - PATCH (rotate password)
PATCH /v1/settings/mailer
Content-Type: application/json
{
"configuration": {
"provider": "SMTP",
"password": "new-smtp-password"
}
}✅ Validation checklist
senderis a valid email andsenderNameis meaningful.- BREVO:
configuration.apiKeypresent (and mirrored to root apiKey for PUT). - SMTP: host, port, username, password, authType=BASIC_AUTH.
- Use PATCH to rotate secrets without resending the full object.
🧯 Troubleshooting
| Symptom | Likely cause | What to check |
|---|---|---|
403 Forbidden | Wrong scope/headers | Use dj-client=OPERATOR with a valid admin API key. |
400 Bad Request on PUT | Missing required fields | Provide all required fields for the chosen provider. |
| SMTP send fails | Wrong host/creds or TLS policy | Verify server, port, username/password and allowed auth. |
| Brevo errors | Invalid/expired API key | Rotate configuration.apiKey via PATCH. |
If Djust configures this for you: share the sender, senderName, and either your Brevo API key or SMTP details (host, port, username, password, auth type). Remember: one mailer config per tenant.
Updated 20 days ago
