From 1726979812704975487f3826cdaee572a15be864 Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Fri, 23 Aug 2024 19:48:57 -0300 Subject: [PATCH] [WIP] Ticket CV2-5067: Fixing e-mail template --- app/mailers/export_list_mailer.rb | 3 ++- app/views/export_list_mailer/send_csv.html.erb | 8 +++++++- app/views/export_list_mailer/send_csv.text.erb | 4 +++- config/locales/en.yml | 7 ++++--- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/mailers/export_list_mailer.rb b/app/mailers/export_list_mailer.rb index 882eff3e0..c9fed76b0 100644 --- a/app/mailers/export_list_mailer.rb +++ b/app/mailers/export_list_mailer.rb @@ -4,7 +4,8 @@ class ExportListMailer < ApplicationMailer def send_csv(csv_file_url, user) @csv_file_url = csv_file_url @user = user - @expire_in = CheckConfig.get('export_csv_expire', 7.days.to_i, :integer) / (60 * 60 * 24) + expire_in = Time.now.to_i + CheckConfig.get('export_csv_expire', 7.days.to_i, :integer) + @expire_in = I18n.l(Time.at(expire_in), format: :email) subject = I18n.t('mails_notifications.export_list.subject') Rails.logger.info "Sending export e-mail to #{@user.email}" mail(to: @user.email, email_type: 'export_list', subject: subject) diff --git a/app/views/export_list_mailer/send_csv.html.erb b/app/views/export_list_mailer/send_csv.html.erb index ec3010e3b..081169fd8 100644 --- a/app/views/export_list_mailer/send_csv.html.erb +++ b/app/views/export_list_mailer/send_csv.html.erb @@ -54,7 +54,7 @@