amelioration(User.mailer.notify_inactive_close_to_deletion): ajoute le mail pour prevenir de la suppression de compte
This commit is contained in:
parent
ea9c571a30
commit
2f28012324
5 changed files with 52 additions and 3 deletions
|
@ -67,7 +67,19 @@ class UserMailer < ApplicationMailer
|
|||
mail(to: administrateur_or_instructeur.email, subject: subject)
|
||||
end
|
||||
|
||||
def notify_inactive_close_to_deletion(user)
|
||||
@user = user
|
||||
@subject = "Votre compte sera supprimé dans #{ExpiredUsersDeletionService::RETENTION_AFTER_NOTICE_IN_WEEK} semaines"
|
||||
|
||||
mail(to: user.email, subject: @subject)
|
||||
end
|
||||
|
||||
def self.critical_email?(action_name)
|
||||
['france_connect_merge_confirmation', "new_account_warning", "ask_for_merge", "invite_instructeur"].include?(action_name)
|
||||
[
|
||||
'france_connect_merge_confirmation',
|
||||
"new_account_warning",
|
||||
"ask_for_merge",
|
||||
"invite_instructeur"
|
||||
].include?(action_name)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class ExpiredUsersDeletionService
|
||||
RETENTION_AFTER_NOTICE = 2.weeks
|
||||
RETENTION_AFTER_NOTICE_IN_WEEK = 2
|
||||
|
||||
def self.process_expired
|
||||
delete_expired_users
|
||||
|
@ -35,6 +35,6 @@ class ExpiredUsersDeletionService
|
|||
end
|
||||
|
||||
def self.expiring_user_notified
|
||||
expiring_users.where.not(inactive_close_to_expiration_notice_sent_at: RETENTION_AFTER_NOTICE.ago..)
|
||||
expiring_users.where.not(inactive_close_to_expiration_notice_sent_at: RETENTION_AFTER_NOTICE_IN_WEEK.weeks.ago..)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
- content_for(:title, @subject)
|
||||
|
||||
%p
|
||||
Bonjour,
|
||||
|
||||
%p
|
||||
Cela fait plus de deux ans que vous ne vous êtes pas connecté à #{APPLICATION_NAME}.
|
||||
%br
|
||||
Dans le respect du RGPD, nous allons
|
||||
%strong supprimer votre compte d'ici #{distance_of_time_in_words(ExpiredUsersDeletionService::RETENTION_AFTER_NOTICE_IN_WEEK.weeks)}.
|
||||
|
||||
%p
|
||||
%strong Ne vous en faites pas,
|
||||
vos dossiers restent conservé par l'administration. À tout moment vous pourrez re-créer une compte sur notre plateforme.
|
||||
%br
|
||||
Mais dans l'attente, nous tenons a respecter le RGPD et protéger ainsi votre vie privée.
|
||||
|
||||
= render partial: "layouts/mailers/signature"
|
Loading…
Add table
Add a link
Reference in a new issue