Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-08-19 22:35:08 +0300
committerDouwe Maan <douwe@gitlab.com>2015-08-19 22:35:08 +0300
commita8a861ae2a122b310d1aca6f9f9b1d0601b8c49f (patch)
tree0ac781a4036e8ca65d5f697c7a30f910db7ddd25 /app/mailers/notify.rb
parent03b54f1f0324c4d424d66e4bf36e42c2a88fc26d (diff)
Add BaseMailer to house shared mailer functionality.
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r--app/mailers/notify.rb33
1 files changed, 1 insertions, 32 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index b4c83f8c5fc..1a2286f9d47 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -1,4 +1,4 @@
-class Notify < ActionMailer::Base
+class Notify < BaseMailer
include ActionDispatch::Routing::PolymorphicRoutes
include Emails::Issues
@@ -8,22 +8,9 @@ class Notify < ActionMailer::Base
include Emails::Profile
include Emails::Groups
- add_template_helper ApplicationHelper
- add_template_helper GitlabMarkdownHelper
add_template_helper MergeRequestsHelper
add_template_helper EmailsHelper
- attr_accessor :current_user
- helper_method :current_user, :can?
-
- default from: Proc.new { default_sender_address.format }
- default reply_to: Proc.new { default_reply_to_address.format }
-
- # Just send email with 2 seconds delay
- def self.delay
- delay_for(2.seconds)
- end
-
def test_email(recipient_email, subject, body)
mail(to: recipient_email,
subject: subject,
@@ -69,20 +56,6 @@ class Notify < ActionMailer::Base
private
- # The default email address to send emails from
- def default_sender_address
- address = Mail::Address.new(Gitlab.config.gitlab.email_from)
- address.display_name = Gitlab.config.gitlab.email_display_name
- address
- end
-
- # The default email address to send emails from
- def default_reply_to_address
- address = Mail::Address.new(Gitlab.config.gitlab.email_reply_to)
- address.display_name = Gitlab.config.gitlab.email_display_name
- address
- end
-
def can_send_from_user_email?(sender)
sender_domain = sender.email.split("@").last
self.class.allowed_email_domains.include?(sender_domain)
@@ -197,10 +170,6 @@ class Notify < ActionMailer::Base
mail_thread(model, headers)
end
- def can?
- Ability.abilities.allowed?(user, action, subject)
- end
-
def reply_key
@reply_key ||= Gitlab::ReplyByEmail.reply_key
end