From 8bc040ae8b5fb062664f2cefabaa884932c31321 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 9 Mar 2021 11:34:39 +0100 Subject: [PATCH] show group in email notif on account creation --- CHANGELOG.md | 1 + .../notify_admin_when_user_is_created.html.erb | 9 ++++++++- config/locales/mails.en.yml | 1 + config/locales/mails.fr.yml | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 036e7b32f..c3e5d15ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next release - Prevent showing error message when testing for old versions during upgrade +- In the email notification, sent to admins on account creation, show the group of the user ## v4.7.5 2021 March 08 - Fix a bug: unable to compile the assets during the upgrade, if the env file has some whitespaces around the equal sign diff --git a/app/views/notifications_mailer/notify_admin_when_user_is_created.html.erb b/app/views/notifications_mailer/notify_admin_when_user_is_created.html.erb index f7db42522..f994e2be5 100644 --- a/app/views/notifications_mailer/notify_admin_when_user_is_created.html.erb +++ b/app/views/notifications_mailer/notify_admin_when_user_is_created.html.erb @@ -1,6 +1,13 @@ <%= render 'notifications_mailer/shared/hello', recipient: @recipient %> -

<%= t('.body.new_account_created') %> "<%= @attached_object&.profile&.full_name || t('api.notifications.deleted_user') %> <<%= @attached_object.email%>>"

+

+ <%= t('.body.new_account_created') %> + "<%= @attached_object&.profile&.full_name || t('api.notifications.deleted_user') %> <<%= @attached_object.email%>>" +

+ +

+ <%= t('.body.user_of_group_html', { GROUP: @attached_object&.group&.name }) %> +

<% if @attached_object.invoicing_profile.organization %>

<%= t('.body.account_for_organization') %> <%= @attached_object.invoicing_profile.organization.name %>

diff --git a/config/locales/mails.en.yml b/config/locales/mails.en.yml index bca9a14a6..decb0c21f 100644 --- a/config/locales/mails.en.yml +++ b/config/locales/mails.en.yml @@ -100,6 +100,7 @@ en: subject: "A user account has been created" body: new_account_created: "A new user account has been created on the website:" + user_of_group_html: "The user has registered in the group %{GROUP}" account_for_organization: "This account manage an organization:" notify_admin_subscribed_plan: subject: "A subscription has been purchased" diff --git a/config/locales/mails.fr.yml b/config/locales/mails.fr.yml index 210d8cda2..d01d14f91 100644 --- a/config/locales/mails.fr.yml +++ b/config/locales/mails.fr.yml @@ -100,6 +100,7 @@ fr: subject: "Un compte utilisateur a été créé" body: new_account_created: "Un nouveau compte utilisateur vient d'être créé sur la plateforme :" + user_of_group_html: "L'utilisateur s'est inscrit dans le groupe %{GROUP}" account_for_organization: "Ce compte gère une structure :" notify_admin_subscribed_plan: subject: "Un abonnement a été souscrit"