From 5ce6d4486ecdda7b893c5ff0b1333dfc872396a8 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 11 Oct 2017 11:56:43 +0200 Subject: [PATCH] fix profile complete mail template for non imported users --- .../notify_admin_profile_complete.html.erb | 11 +++++++++-- config/locales/mails.en.yml | 3 ++- config/locales/mails.fr.yml | 3 ++- config/locales/mails.pt.yml | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/views/notifications_mailer/notify_admin_profile_complete.html.erb b/app/views/notifications_mailer/notify_admin_profile_complete.html.erb index 030b8cb17..c748a7e76 100644 --- a/app/views/notifications_mailer/notify_admin_profile_complete.html.erb +++ b/app/views/notifications_mailer/notify_admin_profile_complete.html.erb @@ -1,7 +1,14 @@ <% provider = AuthProvider.from_strategy_name(@attached_object.provider) %> <%= render 'notifications_mailer/shared/hello', recipient: @recipient %> -

<%= t('.body.account_completed', PROVIDER: provider.name) %> +<% if provider.name == AuthProvider::SimpleAuthProvider.new.name %> +

<%= t('.body.account_completed') %> <%= "#{@attached_object.profile.full_name}" %> <<%= @attached_object.email%>>.

+<% else %> +

<%= t('.body.imported_account_completed', PROVIDER: provider.name) %> + <%= "#{@attached_object.profile.full_name}" %> <<%= @attached_object.email%>>.

+<% end %> -

<%= t('.body.provider_id', UID: @attached_object.uid) %>

+<% if @attached_object.uid %> +

<%= t('.body.provider_id', UID: @attached_object.uid) %>

+<% end %> \ No newline at end of file diff --git a/config/locales/mails.en.yml b/config/locales/mails.en.yml index 4b89afb1b..bf07eca6b 100644 --- a/config/locales/mails.en.yml +++ b/config/locales/mails.en.yml @@ -228,7 +228,8 @@ en: notify_admin_profile_complete: subject: "An imported account has completed its profile" body: - account_completed: "A previously imported user account via %{PROVIDER} has completed its profile:" + account_completed: "An user account has completed its profile:" + imported_account_completed: "An user account, previously imported through %{PROVIDER}, has completed its profile:" provider_id: "its provider ID is:" notify_admin_abuse_reported: diff --git a/config/locales/mails.fr.yml b/config/locales/mails.fr.yml index 76019d5d6..0758de602 100644 --- a/config/locales/mails.fr.yml +++ b/config/locales/mails.fr.yml @@ -228,7 +228,8 @@ fr: notify_admin_profile_complete: subject: "Un compte importé a complété ses informations" body: - account_completed: "Un compte utilisateur précédemment importé via %{PROVIDER} vient de compléter ses informations de profil :" + account_completed: "Un compte utilisateur vient de compléter ses informations de profil :" + imported_account_completed: "Un compte utilisateur précédemment importé via %{PROVIDER} vient de compléter ses informations de profil :" provider_id: "Son identifiant fournisseur est %{UID}" notify_admin_abuse_reported: diff --git a/config/locales/mails.pt.yml b/config/locales/mails.pt.yml index 0cae46c74..e31020eb0 100755 --- a/config/locales/mails.pt.yml +++ b/config/locales/mails.pt.yml @@ -228,7 +228,8 @@ pt: notify_admin_profile_complete: subject: "Uma conta importada teve o perfil completado" body: - account_completed: "Uma conta de usuário importada anteriormente via %{PROVIDER} completou seu perfil:" + account_completed: "Uma conta de usuário completou seu perfil:" + imported_account_completed: "Uma conta de usuário importada anteriormente via %{PROVIDER} completou seu perfil:" provider_id: "Seu ID de provedor é:" notify_admin_abuse_reported: