Skip to content
Snippets Groups Projects
Commit 946c7f00 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

feat: opt-in newsletter

parent 290d5762
No related branches found
No related tags found
No related merge requests found
Pipeline #108214 passed
...@@ -18,6 +18,24 @@ Par exemple, le 3 juin, un utilisateur pourra voir son analyse de Mai. ...@@ -18,6 +18,24 @@ Par exemple, le 3 juin, un utilisateur pourra voir son analyse de Mai.
Les utilisateurs ne seront pas bloqués pour naviguer dans les dates précédentes, et s'il n'y a pas d'analyse à afficher, nous affichons des tirets à la place des données. Les utilisateurs ne seront pas bloqués pour naviguer dans les dates précédentes, et s'il n'y a pas d'analyse à afficher, nous affichons des tirets à la place des données.
## Bloc rappel inscription à la newsletter
Depuis la version 3.1.0 d'Ecolyo, l'inscription à la newsletter est facultative lors de la création du compte. Ce bloc permet de rappeler aux utilisateurs de s'inscrire à la newsletter.
![newsletter-reminder](/img/ecolyo/newsletter-reminder.png)
### Interactions
Si l'utilisateur clique sur la croix, le message disparaît jusqu'au rechargement de l'application. Pour cela on met à jour la variable `haveSeenNewsletterReminder` à `true` dans le store de l'analyse. Celle-ci est initialisée à `false` lors du chargement de l'application.
Si l'utilisateur clique sur le bouton "Je m'inscris", il est inscrit à la newsletter et le message disparaît. Pour cela on met à jour la variable `sendAnalysisNotification` à `true` dans le profil de l'utilisateur.
Si l'utilisateur clique sur le bouton "Ne plus afficher", le message ne s'affichera plus jamais. Pour cela on met à jour la variable `isAnalysisReminderEnabled` à `false` dans le profil de l'utilisateur. Celle-ci est initialisée à `true` lors de la migration de l'application en version 3.1.0.
### Affichage
Le message est affiché en haut de l'écran, uniquement si l'utilisateur n'est pas déjà inscrit à la newsletter et qu'il n'a pas déjà fermé ce message durant la session ET qu'il n'a pas encore cliqué sur le bouton "Ne plus afficher".
## Bloc Comparaison avec mois précédent ou année précédente ## Bloc Comparaison avec mois précédent ou année précédente
Ce bloc est divisé en deux parties, une première concernant la température moyenne et l'autre la consommation. Ce bloc est divisé en deux parties, une première concernant la température moyenne et l'autre la consommation.
......
...@@ -4,7 +4,7 @@ This section explains the way we handle terms in the application. ...@@ -4,7 +4,7 @@ This section explains the way we handle terms in the application.
## Description ## Description
The terms version is handled with the _io.cozy.terms_ doctype. It is incremented each time we edit the CGU, the data consent validation or the legal notices. Once we increment the terms version, the user will be prompted to accept these terms, otherwise we won't be able to access the app. The terms version is handled with the *io.cozy.terms* doctype. It is incremented each time we edit the CGU, the data consent validation or the legal notices. Once we increment the terms version, the user will be prompted to accept these terms, otherwise we won't be able to access the app.
### Private Routes ### Private Routes
...@@ -12,16 +12,18 @@ All routes are private, and are accessible only if the user has accepted the las ...@@ -12,16 +12,18 @@ All routes are private, and are accessible only if the user has accepted the las
The only public routes are : The only public routes are :
- _/terms_ : shows the terms validation page, and is the main page the user is redirected to if his consent is outdated - */terms* : shows the terms validation page, and is the main page the user is redirected to if his consent is outdated
- _/cgu_ : shows the CGU public page, accessible by the terms page - */cgu* : shows the CGU public page, accessible by the terms page
- _/legal_ : shows the Legal Notice public page, accessible by the terms page - */legal* : shows the Legal Notice public page, accessible by the terms page
### Terms management ### Terms management
We check the terms acceptation in the **splash screen** while the application is initializing, if there is no consent (first connection), or the consent is outdated (update of terms), the user will be redirected to the terms acceptation page. We check the terms acceptation in the **splash screen** while the application is initializing, if there is no consent (first connection), or the consent is outdated (update of terms), the user will be redirected to the terms acceptation page.
For the full terms acceptation process, the user has to check the two checkboxes (one for Data share consent, and one for CGU and Legal Notice) to unlock the terms acceptation button. Once he has accepted it, a new term doctype is created with the value _accepted_ to true. So he can access now the entire application. For the full terms acceptation process, the user has to check the two checkboxes (one for Data share consent, and one for CGU and Legal Notice) to unlock the terms acceptation button. Once he has accepted it, a new term doctype is created with the value *accepted* to true. So he can access now the entire application.
We store in user's profile a boolean _showConsentModal_ that allows the app to know about the consent status. We store in user's profile a boolean *showConsentModal* that allows the app to know about the consent status.
If the user is not subscribed to the newsletter, a third facultative checkbox is displayed. If the user checks it, he will be subscribed to the newsletter.
If there is a consent update, two cases are possible : If there is a consent update, two cases are possible :
......
static/img/ecolyo/newsletter-reminder.png

23.7 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment