Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Jcofles/Proyecto-web/llms.txt

Use this file to discover all available pages before exploring further.

UniMaps sends transactional emails for every significant user action that requires out-of-band verification. Without a working email configuration, users cannot complete registration, reset passwords, or receive security codes. This page explains how to configure the two supported providers — Gmail SMTP and Brevo — and lists every place in the application where email is sent.

When emails are sent

UniMaps triggers outgoing email for the following events:
EventDescription
Registration verificationA link is emailed to the registrant. The account is not created in the users table until the link is clicked.
Two-factor authenticationA one-time code is sent to the user’s email during login when 2FA is active.
Password resetA short numeric code is sent to the user’s email address to authorize a password reset.
Secure key deliveryThe user’s API key or access credential is delivered by email.
Email change verificationWhen a user requests an email address change, a code is sent to the new address to confirm ownership.
Account deletion confirmationThe user receives a final notification when their account is permanently removed.

Provider options

Gmail SMTP

Use your Gmail account as an SMTP relay. Requires a Google App Password. Best for low-volume deployments or when you already have a Google Workspace account.

Brevo (Sendinblue) API

Use the Brevo transactional email API. No SMTP relay needed. The backend calls the Brevo REST API directly using BREVO_API_KEY. Better for higher volumes or when you want detailed delivery analytics.

Gmail SMTP setup

1

Enable two-factor authentication on your Google account

App Passwords are only available when 2FA is active. Go to myaccount.google.com, open Security, and enable 2-Step Verification if it is not already on.
2

Generate an App Password

In your Google account under Security, locate App Passwords. Create a new password for “Mail” on “Other device” (name it something like UniMaps). Google will display a 16-character password — copy it immediately, as it will not be shown again.
3

Set the environment variables

Add the following to your .env (or your deployment platform’s environment variable UI):
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-address@gmail.com
MAIL_PASSWORD=abcdefghijklmnop
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-address@gmail.com
MAIL_FROM_NAME="ITFIP Maps"
Replace your-address@gmail.com with your actual Gmail address and abcdefghijklmnop with the 16-character App Password (no spaces).
4

Clear the config cache

After saving the .env changes, clear Laravel’s cached configuration so the new values are picked up:
php artisan config:clear
php artisan cache:clear
Do not use your regular Gmail password for MAIL_PASSWORD. Google blocks SMTP authentication with account passwords. You must use an App Password generated in the step above. If you see an “Authentication failed” error, verify that 2FA is active on the account and that the App Password has exactly 16 characters with no spaces.

Gmail SMTP variables reference

VariableValue
MAIL_MAILERsmtp
MAIL_HOSTsmtp.gmail.com
MAIL_PORT587
MAIL_ENCRYPTIONtls
MAIL_USERNAMEYour Gmail address
MAIL_PASSWORD16-character App Password
MAIL_FROM_ADDRESSYour Gmail address (or a verified sender)
MAIL_FROM_NAMEDisplay name shown to recipients

Brevo (Sendinblue) API setup

The EmailService class (Clase1/app/Services/EmailService.php) can send email through the Brevo transactional email API instead of an SMTP relay. When using this path, no MAIL_* variables are required — only the Brevo API key.
1

Create a Brevo account

Sign up at brevo.com and verify your sender domain or email address in the Brevo dashboard.
2

Generate an API key

In the Brevo dashboard, go to SMTP & APIAPI Keys and create a new key with transactional email permissions.
3

Set the environment variable

BREVO_API_KEY=xkeysib-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx
When using Brevo, the sender address is set directly in EmailService.php. If you need to change the sender name or address, update that file. The MAIL_FROM_ADDRESS and MAIL_FROM_NAME variables are not read by the Brevo code path.

Testing email in development

Use Mailtrap to capture outgoing emails during development without sending real messages. Create a free inbox and use the SMTP credentials Mailtrap provides:
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=your_mailtrap_username
MAIL_PASSWORD=your_mailtrap_password
MAIL_ENCRYPTION=null
All emails sent by the application will appear in your Mailtrap inbox instead of being delivered to real addresses.
You can also verify SMTP connectivity directly from the Laravel REPL:
php artisan tinker
Mail::raw('Test message from UniMaps', function ($message) {
    $message->to('you@example.com')->subject('UniMaps SMTP test');
});
If null is returned with no exception, the message was accepted by the SMTP server. Check your inbox (and the spam folder) to confirm delivery. If you see an error, check storage/logs/laravel.log for the full error message.

Build docs developers (and LLMs) love