Signia uses Brevo (formerly Sendinblue) as its transactional email provider through a custom Django email backend located atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jtapieromalambo-ctrl/Signia/llms.txt
Use this file to discover all available pages before exploring further.
usuarios/email_backend.py. Rather than routing email through SMTP, the backend sends messages directly to Brevo’s REST API, which is more reliable in serverless and containerised environments where SMTP ports may be blocked or rate-limited. All email-sending behaviour is centralised in this single backend class — no third-party Django packages are required beyond the requests library.
Emails Signia Sends
| Trigger | Description |
|---|---|
| New user registration | A 6-digit OTP verification code (valid for 10 minutes) |
| Successful registration | A welcome message confirming the account is active |
| Password change | A confirmation notification after the user updates their password |
| Password recovery | A recovery link or code to reset a forgotten password |
Setting Up Brevo
Create a Brevo account
Go to brevo.com and sign up for a free account. The free tier includes 300 emails per day, which is sufficient for development and small production deployments.
Generate an API key
In the Brevo dashboard, navigate to Settings → API Keys and click Create a new API key. Give the key a descriptive name (e.g.
signia-production). Copy the generated key immediately — Brevo will not show it again.Required Environment Variables
EMAIL_HOST_PASSWORD can be left empty when using the Brevo backend. The custom BrevoEmailBackend authenticates using BREVO_API_KEY via the REST API — it does not establish an SMTP connection and therefore does not use the host password at all.Email Settings in settings.py
The following email-related settings are defined directly insettings.py. They do not need to be set as environment variables:
EMAIL_HOST and EMAIL_HOST_USER are loaded from environment variables via python-decouple. EMAIL_PORT, EMAIL_USE_TLS, and EMAIL_USE_SSL are hardcoded to the correct values for Brevo’s SMTP relay and do not need to be overridden.
How the Custom Backend Works
TheBrevoEmailBackend class in usuarios/email_backend.py extends Django’s BaseEmailBackend and overrides send_messages(). For each EmailMessage object Django passes to it, the backend:
- Extracts the plain-text body and, if present, the HTML alternative from
msg.alternatives. - Builds a JSON payload matching Brevo’s
/v3/smtp/emailAPI format. - POSTs the payload to
https://api.brevo.com/v3/smtp/emailwith theapi-keyheader set toBREVO_API_KEY. - Calls
response.raise_for_status()to surface API errors; iffail_silently=Truewas passed to the backend, exceptions are swallowed.
settings.py as:
OTP Verification Details
When a new user registers, Signia generates aCodigoOTP record with these properties:
| Property | Value |
|---|---|
| Code length | 6 digits |
| Expiry | 10 minutes from creation |
| Active codes per user | 1 (previous codes are invalidated on re-send) |
| Delivery method | Email via BrevoEmailBackend |
Testing Email in Development
During local development you may want to inspect outgoing emails without actually sending them. Switch to Django’s built-in console backend by temporarily settingEMAIL_BACKEND in your shell before starting the server:
settings.py (do not commit it):
runserver. Switch back to 'usuarios.email_backend.BrevoEmailBackend' before deploying.