From 20de47235e39e585ac1c8746fc9c4f673da910a0 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Sun, 25 Sep 2016 17:06:09 +0100 Subject: Wrap List-Unsubscribe link in angle brackets --- app/mailers/notify.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/mailers') diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 9799f1dc886..29f1c527776 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -109,7 +109,7 @@ class Notify < BaseMailer headers['X-GitLab-Reply-Key'] = reply_key if !@labels_url && @sent_notification && @sent_notification.unsubscribable? - headers['List-Unsubscribe'] = unsubscribe_sent_notification_url(@sent_notification, force: true) + headers['List-Unsubscribe'] = "<#{unsubscribe_sent_notification_url(@sent_notification, force: true)}>" @sent_notification_url = unsubscribe_sent_notification_url(@sent_notification) end -- cgit v1.2.1 From 74c8e091f40c29a59b99bf7864b9fee303c68e50 Mon Sep 17 00:00:00 2001 From: Fu Xu Date: Fri, 2 Sep 2016 16:57:08 +0800 Subject: add configurable email subject suffix --- app/mailers/notify.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/mailers') diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 29f1c527776..1321b42ddf4 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -92,6 +92,7 @@ class Notify < BaseMailer subject = "" subject << "#{@project.name} | " if @project subject << extra.join(' | ') if extra.present? + subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.length > 0 subject end -- cgit v1.2.1 From 64a60bc4545cbf85b3a025edd63bdaefd8cd9499 Mon Sep 17 00:00:00 2001 From: Fu Xu Date: Thu, 29 Sep 2016 16:09:47 +0800 Subject: wrap subject with method subject --- app/mailers/emails/members.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/mailers') diff --git a/app/mailers/emails/members.rb b/app/mailers/emails/members.rb index 45311690293..7b617b359ea 100644 --- a/app/mailers/emails/members.rb +++ b/app/mailers/emails/members.rb @@ -45,7 +45,7 @@ module Emails @token = token mail(to: member.invite_email, - subject: "Invitation to join the #{member_source.human_name} #{member_source.model_name.singular}") + subject: subject("Invitation to join the #{member_source.human_name} #{member_source.model_name.singular}")) end def member_invite_accepted_email(member_source_type, member_id) -- cgit v1.2.1 From 76463c2cb460099559b8544396cf1a6656895e8d Mon Sep 17 00:00:00 2001 From: Fu Xu Date: Fri, 30 Sep 2016 17:46:37 +0800 Subject: override subject method in devise mailer --- app/mailers/devise_mailer.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/mailers') diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb index 415f6e12885..bd4c1c9226a 100644 --- a/app/mailers/devise_mailer.rb +++ b/app/mailers/devise_mailer.rb @@ -3,4 +3,12 @@ class DeviseMailer < Devise::Mailer default reply_to: Gitlab.config.gitlab.email_reply_to layout 'devise_mailer' + + protected + + def subject_for(key) + subject = super + subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.length > 0 + subject + end end -- cgit v1.2.1 From 867b9b43472508f0f8cead53b0e9fff89edd9064 Mon Sep 17 00:00:00 2001 From: Fu Xu Date: Fri, 30 Sep 2016 21:06:11 +0800 Subject: change determine conditions --- app/mailers/devise_mailer.rb | 2 +- app/mailers/notify.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/mailers') diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb index bd4c1c9226a..f7ed61625f4 100644 --- a/app/mailers/devise_mailer.rb +++ b/app/mailers/devise_mailer.rb @@ -8,7 +8,7 @@ class DeviseMailer < Devise::Mailer def subject_for(key) subject = super - subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.length > 0 + subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.present? subject end end diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 1321b42ddf4..2444702104e 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -92,7 +92,7 @@ class Notify < BaseMailer subject = "" subject << "#{@project.name} | " if @project subject << extra.join(' | ') if extra.present? - subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.length > 0 + subject << " | #{Gitlab.config.gitlab.email_subject_suffix}" if Gitlab.config.gitlab.email_subject_suffix.present? subject end -- cgit v1.2.1