From 20e60145e1bad731746a066020584d359f4b484d Mon Sep 17 00:00:00 2001 From: Sawy Date: Thu, 26 Oct 2023 10:58:04 +0300 Subject: [PATCH] CV2-3798: update mail logo for all mails templates --- app/mailers/application_mailer.rb | 2 ++ app/mailers/devise_mailer.rb | 12 +++++++++--- app/mailers/feed_invitation_mailer.rb | 3 --- public/images/checklogo.png | Bin 0 -> 6499 bytes 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 public/images/checklogo.png diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 1f8b23b819..a9b627c780 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -30,6 +30,8 @@ def mail(options={}) return if options[:to].blank? options[:to] = [options[:to]].flatten.collect{ |to| to.gsub(/[\u200B-\u200D\uFEFF]/, '') } @direction = ApplicationMailer.set_template_direction + attachments.inline['checklogo.png'] = File.read('public/images/checklogo.png') + @logo_url = attachments['checklogo.png'].url super(options) end diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb index cd692ed1e4..2c651e30c9 100644 --- a/app/mailers/devise_mailer.rb +++ b/app/mailers/devise_mailer.rb @@ -5,7 +5,7 @@ class DeviseMailer < Devise::Mailer def confirmation_instructions(record, token, opts={}) @host = CheckConfig.get('checkdesk_base_url') @client_host = CheckConfig.get('checkdesk_client') - @direction = ApplicationMailer.set_template_direction + self.set_direction_and_logo opts[:subject] = I18n.t(:mail_account_confirmation, app_name: CheckConfig.get('app_name')) super end @@ -13,7 +13,7 @@ def confirmation_instructions(record, token, opts={}) def reset_password_instructions(record, token, opts={}) @host = CheckConfig.get('checkdesk_base_url') @title = I18n.t("mails_notifications.reset_password.title") - @direction = ApplicationMailer.set_template_direction + self.set_direction_and_logo opts[:subject] = I18n.t('devise.mailer.reset_password_instructions.subject', app_name: CheckConfig.get('app_name')) super end @@ -29,10 +29,16 @@ def invitation_instructions(record, token, opts={}) @invited_type = @invited_text.blank? ? 'default' : 'custom' @due_at = opts[:due_at] @title = I18n.t("mails_notifications.invitation.title") - @direction = ApplicationMailer.set_template_direction + self.set_direction_and_logo tu = record.team_users.where(team_id: @team.id).last opts[:to] = tu.invitation_email unless tu.nil? opts[:subject] = I18n.t(:'devise.mailer.invitation_instructions.subject', user: @invited_by, team: @team.name) super end + + def set_direction_and_logo + @direction = ApplicationMailer.set_template_direction + attachments.inline['checklogo.png'] = File.read('public/images/checklogo.png') + @logo_url = attachments['checklogo.png'].url + end end diff --git a/app/mailers/feed_invitation_mailer.rb b/app/mailers/feed_invitation_mailer.rb index c63229c13c..82412342b4 100644 --- a/app/mailers/feed_invitation_mailer.rb +++ b/app/mailers/feed_invitation_mailer.rb @@ -5,11 +5,8 @@ def notify(record) @recipient = record.email @user = record.user @feed = record.feed - @direction = ApplicationMailer.set_template_direction @due_at = record.created_at + CheckConfig.get('feed_invitation_due_to', 30).to_i.days subject = I18n.t("mails_notifications.feed_invitation.subject", user: @user.name, feed: @feed.name) - attachments.inline['check_logo.png'] = File.read("#{Rails.root}/public/images/check.svg") - @logo_url = attachments['check_logo.png'].url Rails.logger.info "Sending a feed invitation e-mail to #{@recipient}" mail(to: @recipient, email_type: 'feed_invitation', subject: subject) end diff --git a/public/images/checklogo.png b/public/images/checklogo.png new file mode 100644 index 0000000000000000000000000000000000000000..9de2cf35ba46345eec3387653f511d3cdfcb01bb GIT binary patch literal 6499 zcmV-p8Jy;cP)_HMxq(M=D<3rD)U8I-7(HKSBpgD+^RachDoxIGL45Lx3}hlAq6xjp-yD7Z?6%h+7UthSdfwYFp49J$CL$tQCa-G7FF#%xB;{bO zP_N7yG7%9GPK9yr$>hA@K(Ed~CL*HF8#hyzwc@}*EZAgCL_}29j2o#HpMDptArlc% zXZ2)>%SMA(u!c-TL><<{Xw*jx7|29K)KNVo$-9UJ1DS}3I;dBmND&hTG7%AVOt10& z;%OMjL`2jfJ;aKEOhiN-5pNg^1~L&5b%5zJMvj;@F>*x8{9Fa<+giq(o~UW&wv^22qn^y%mz!8Jt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