diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f966a8a..30a0c9f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fix a bug: warning message overflow in credit wallet modal - Fix a bug: when using a cash coupon, the amount shown in the statistics is invalid - Fix a bug: unable to create a coupon on stripe +- Fix a bug: no notifications for refunds generated on wallet credit - [TODO DEPLOY] `rails fablab:maintenance:rebuild_stylesheet` - [TODO DEPLOY] `rails fablab:stripe:set_product_id` - [TODO DEPLOY] `rails fablab:setup:add_schedule_reference` diff --git a/app/views/notifications_mailer/notify_admin_refund_created.html.erb b/app/views/notifications_mailer/notify_admin_refund_created.html.erb index d0ec9e8ad..300cb54fe 100644 --- a/app/views/notifications_mailer/notify_admin_refund_created.html.erb +++ b/app/views/notifications_mailer/notify_admin_refund_created.html.erb @@ -3,6 +3,9 @@
<%= t('.body.refund_created', AMOUNT: number_to_currency(@attached_object.total / 100.00), INVOICE: @attached_object.invoice.reference, - USER: @attached_object.invoicing_profile&.full_name) %> + USER: @attached_object.invoicing_profile&.full_name) if @attached_object.invoice %> + <%= t('.body.wallet_refund_created', + AMOUNT: number_to_currency(@attached_object.total / 100.00), + USER: @attached_object.invoicing_profile&.full_name) if @attached_object.invoiced_type === WalletTransaction.name %>
diff --git a/config/locales/mails.en.yml b/config/locales/mails.en.yml index 395c472b7..2580d9859 100644 --- a/config/locales/mails.en.yml +++ b/config/locales/mails.en.yml @@ -272,6 +272,7 @@ en: subject: "A refund has been generated" body: refund_created: "A refund of %{AMOUNT} has been generated on invoice %{INVOICE} of user %{USER}" + wallet_refund_created: "A refund of %{AMOUNT} has been generated for the credit of the wallet of user %{USER}" download: "Click here to download this refund invoice" notify_admins_role_update: subject: "The role of a user has changed" diff --git a/config/locales/mails.fr.yml b/config/locales/mails.fr.yml index 381ceceb1..8bbb7c850 100644 --- a/config/locales/mails.fr.yml +++ b/config/locales/mails.fr.yml @@ -272,6 +272,7 @@ fr: subject: "Un avoir a été généré" body: refund_created: "Un avoir de %{AMOUNT} a été généré sur la facture %{INVOICE} de l'utilisateur %{USER}" + wallet_refund_created: "Un avoir de %{AMOUNT} a été généré pour le crédit du porte-monnaie de l'utilisateur %{USER}" download: "Cliquez ici pour télécharger cet avoir" notify_admins_role_update: subject: "Le rôle d'un utilisateur a changé"