diff --git a/CHANGELOG.md b/CHANGELOG.md index 0502791a2..463df1220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog Fab Manager +- Improved notification email to the member when a rolling subscription is taken - Handle Ctrl^C in upgrade scripts - Updated moment-timezone diff --git a/app/views/notifications_mailer/notify_member_subscribed_plan.html.erb b/app/views/notifications_mailer/notify_member_subscribed_plan.html.erb index 327a0e9f2..808231770 100644 --- a/app/views/notifications_mailer/notify_member_subscribed_plan.html.erb +++ b/app/views/notifications_mailer/notify_member_subscribed_plan.html.erb @@ -2,4 +2,9 @@

<%= t('.body.plan_subscribed_html', PLAN: @attached_object.plan.human_readable_name) %>

-

<%= t('.body.subscription_stops_on', DATE: I18n.l(@attached_object.expired_at.to_date)) %>

+<% if @attached_object.plan.is_rolling && @recipient.trainings.count.zero? %> + <% duration = I18n.t("duration.#{@attached_object.plan.interval}", count: @attached_object.plan.interval_count) %> +

<%= t('.body.rolling_subscription_stops_on', DURATION: duration, DATE: I18n.l(@attached_object.expired_at.to_date)) %>

+<% else %> +

<%= t('.body.subscription_stops_on', DATE: I18n.l(@attached_object.expired_at.to_date)) %>

+<% end %> diff --git a/config/locales/mails.en.yml b/config/locales/mails.en.yml index 9aea143be..e50ef8934 100644 --- a/config/locales/mails.en.yml +++ b/config/locales/mails.en.yml @@ -80,7 +80,8 @@ en: subject: "Your subscription has been successfully purchased" body: plan_subscribed_html: "You have subscribed the plan: %{PLAN}." - subscription_stops_on: "Your subscription plan will end on %{DATE}" + rolling_subscription_stops_on: "Your subscription will end %{DURATION} after your first training. Otherwise, it will stop on %{DATE}." + subscription_stops_on: "Your subscription will end on %{DATE}." notify_member_create_reservation: subject: "Your reservation has been successfully saved" diff --git a/config/locales/mails.es.yml b/config/locales/mails.es.yml index 98c80b22a..0341c8b66 100644 --- a/config/locales/mails.es.yml +++ b/config/locales/mails.es.yml @@ -80,7 +80,8 @@ es: subject: "Su suscripción ha sido correctamente comprada" body: plan_subscribed_html: "Se ha suscrito al plan: %{PLAN}." - subscription_stops_on: "Su suscripción terminará el %{DATE}" + rolling_subscription_stops_on: "Su suscripción terminará %{DURATION} después de su primer entrenamiento. De lo contrario, se detendrá el %{DATE}." + subscription_stops_on: "Su suscripción terminará el %{DATE}." notify_member_create_reservation: subject: "Su reserva se ha registrado correctamente" diff --git a/config/locales/mails.fr.yml b/config/locales/mails.fr.yml index b70eaa751..5f1601c6a 100644 --- a/config/locales/mails.fr.yml +++ b/config/locales/mails.fr.yml @@ -80,7 +80,8 @@ fr: subject: "Votre abonnement a bien été souscrit" body: plan_subscribed_html: "Vous avez souscrit à l'abonnement : %{PLAN}." - subscription_stops_on: "Votre abonnement s'arrêtera automatiquement le %{DATE}" + rolling_subscription_stops_on: "Votre abonnement s'arrêtera automatiquement %{DURATION} après votre première formation. À défaut, il s'arrêtera le %{DATE}." + subscription_stops_on: "Votre abonnement s'arrêtera automatiquement le %{DATE}." notify_member_create_reservation: subject: "Votre réservation a bien été enregistrée" diff --git a/config/locales/mails.pt.yml b/config/locales/mails.pt.yml index 20db2994f..ae2c14662 100755 --- a/config/locales/mails.pt.yml +++ b/config/locales/mails.pt.yml @@ -80,7 +80,8 @@ pt: subject: "Sua assinatura foi adquirida com êxito" body: plan_subscribed_html: "Você assinou o plano: %{PLAN}." - subscription_stops_on: "Seu plano de assinatura termina em %{DATE}" + rolling_subscription_stops_on: "Sua assinatura encerrará %{DURATION} após seu primeiro treinamento. Caso contrário, ele será interrompido em %{DATE}." + subscription_stops_on: "Sua assinatura será encerrada em %{DATE}." notify_member_create_reservation: subject: "Sua reserva foi salva com sucesso"