Jluc
15 Julio, 2026 08:41
1
Descripción
El envío de SMS es muy práctico, pero hoy en día solo es posible configurar un número. Para compartir las notificaciones, ¿sería posible añadir una clave para un segundo número de Free?
Añadiré que cada clave API debería pertenecer a una cuenta de usuario, lo que permite enviar un mensaje a Monsieur o Madame.
Esta funcionalidad ya estaba en mi lista de pendientes porque hablamos de ello cuando hice esa integración.
He trabajado un poco en ello:
Haré una prueba este fin de semana y pondré una imagen disponible para probar
Listo, cada usuario puede ahora poner su propia clave API Free.
También he añadido en la lista de usuarios la opción de enviar un mensaje a todos
Voy a preparar una imagen si alguien quiere probar
La PR
master ← William-De71:feat/sms-free-multiuser
ouvert 09:06PM - 17 Jul 26 UTC
### Pull Request check-list
- [x] If your changes affect the code, did you wr… ite the tests?
- [x] Are server tests passing with coverage? (`cd server && npm run coverage`) — Codecov requires **100% coverage on lines changed in this PR**
- [ ] Did Cypress E2E tests pass? (`npm run cypress:run` from repo root, if UI changed)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [ ] If you are adding a new feature/service, did you run the integration comparator? (`npm run compare-translations` on front)
- [x] Did you test this pull request in real life? With real devices?
- [ ] If your changes modify the API (REST or Node.js), did you modify the API documentation?
- [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation?
- [x] Did you add fake requests data for the demo mode? (N/A — no new widget)
### Description of change
This PR adds **multi-user support to the Free Mobile integration**.
#### Problem
Until now, only the **admin** account could configure a Free Mobile API key. The customer ID and access token were stored as **global** service variables, so Gladys could only send SMS to that single account. There was no way to send an SMS to another user, nor to build scenes targeting a specific user.
#### Solution
Free Mobile is now aligned with the **Telegram / CallMeBot** pattern:
- **Per-user configuration**: the `FREE_MOBILE_USERNAME` and `FREE_MOBILE_ACCESS_TOKEN` variables are now stored per-user (`userRelated: true`). Each user can enter their own credentials from the integration page to receive SMS.
- **Automatic migration**: on service start, the legacy global configuration (if any) is migrated to the **admin** user's per-user configuration, then the old global variables are removed. Existing installations keep working with no manual action.
- **New message handler**: a `message.send(userId, message)` handler reads the user's own credentials on the fly and sends the SMS.
- **Scene action**: the "Send an SMS" action now has a **recipient selector** — you can send to a specific user, or to **all users** who configured Free Mobile.
## Summary by CodeRabbit
- **New Features**
- Free Mobile credentials are now configured per user.
- Scene SMS actions let you select a recipient (including “all users”).
- The Free Mobile settings page now shows guidance for per-user SMS setup.
- SMS sending now uses the scene text with variables expanded.
- **Bug Fixes**
- The integration loads even when legacy or incomplete Free Mobile credentials are missing.
- Legacy Free Mobile configuration is migrated automatically to per-user settings.
- SMS sending skips recipients missing required credentials and continues for others.
- **Tests**
- Expanded coverage for Free Mobile SMS sending and migration behavior.
y la imagen en curso de build:
docker pull willde71/gladys-test:freemobile
Jluc
17 Julio, 2026 21:19
7
¡Genial! Muchas gracias, @Will_71 . Solo me quedará configurar un segundo usuario