Jluc
15. Juli 2026 um 08:41
1
Beschreibung
Das Senden von SMS ist sehr praktisch, aber es ist heute nur möglich, eine einzige Nummer zu konfigurieren. Um Benachrichtigungen zu teilen, wäre es möglich, einen Schlüssel für eine zweite Free-Nummer hinzuzufügen?
mutmut
15. Juli 2026 um 16:48
2
Ich würde hinzufügen, dass jeder API-Schlüssel einem Benutzerkonto zugeordnet sein sollte, wodurch eine Nachricht an Herrn oder Frau gesendet werden kann.
Diese Funktion stand schon auf meiner TODO-Liste, weil wir darüber gesprochen hatten, als ich diese Integration gemacht hatte.
Ich habe ein bisschen daran gearbeitet:
Ich werde es dieses Wochenende ausprobieren und ein Bild zum Testen bereitstellen.
Das ist gut, jeder Benutzer kann jetzt seinen eigenen Free-API-Schlüssel eingeben.
Ich habe auch in der Benutzerliste die Option hinzugefügt, eine Nachricht an alle zu senden
Ich werde ein Bild vorbereiten, falls jemand testen möchte
Der 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.
die gerade gebaut wird:
docker pull willde71/gladys-test:freemobile
Jluc
17. Juli 2026 um 21:19
7
Super, ein großes Dankeschön @Will_71 . Dann muss ich nur noch einen zweiten Benutzer einrichten