Email & Communication
Gova integrates with Brevo (formerly Sendinblue) to manage transactional emails, including account verification and customer support inquiries. Communication is handled asynchronously using FastAPI background tasks to ensure API responsiveness.
Support Communication
The system provides a public endpoint for users or visitors to send inquiries directly to the Gova support team.
Contact Support
The /public/contact-us endpoint accepts contact form submissions and forwards them to the configured customer support email address.
Endpoint: POST /public/contact-us
Request Body (ContactForm):
| Field | Type | Description |
| :--- | :--- | :--- |
| name | string | The name of the person reaching out. |
| email | string (Email) | The sender's return email address. |
| message | string | The content of the inquiry. |
Example Usage:
curl -X 'POST' \
'https://api.gova.chat/public/contact-us' \
-H 'Content-Type: application/json' \
-d '{
"name": "Jane Doe",
"email": "jane@example.com",
"message": "I would like to inquire about the Enterprise pricing tier."
}'
Email Verification Flow
Gova enforces email verification to ensure account security and validity. This process is triggered during registration and can be re-requested if the code expires or is lost.
1. Requesting Verification
Users can request a new verification code if they are logged in but not yet verified. This endpoint is rate-limited to prevent abuse.
Endpoint: POST /auth/request-email-verification
Authentication: Required (JWT)
Error Responses:
429 Too Many Requests: Triggered if the user exceeds the maximum allowed verification attempts within a specific window.
2. Verifying the Email
Once the user receives the 6-digit code via email, they must submit it to finalize their verification status.
Endpoint: POST /auth/verify-email
Authentication: Required (JWT)
Request Body (VerifyCode):
| Field | Type | Description |
| :--- | :--- | :--- |
| code | string | The verification code sent to the user's email. |
Example Usage:
curl -X 'POST' \
'https://api.gova.chat/auth/verify-email' \
-H 'Authorization: Bearer <your_jwt_token>' \
-H 'Content-Type: application/json' \
-d '{
"code": "123456"
}'
Configuration
To enable email functionality, the backend requires valid Brevo credentials and sender information configured in the environment.
| Variable | Description |
| :--- | :--- |
| BREVO_API_KEY | Your Brevo API key for sending transactional emails. |
| SENDER_NAME | The display name for outgoing emails (e.g., "Gova Support"). |
| SENDER_EMAIL | The verified email address in Brevo used to send emails. |
| CUSTOMER_SUPPORT_EMAIL | The destination address where contact form submissions are sent. |
Internal Role: BrevoEmailService
The BrevoEmailService is an internal utility that abstracts the Brevo API. It handles the formatting of SMTP requests and is called by the AuthService for registration flows and the Public router for contact inquiries. Most email tasks are wrapped in FastAPI BackgroundTasks to prevent blocking the request-response cycle.