From d61268e4f15502d46a61ee34f27248194c2f3f53 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Tue, 22 Nov 2011 23:36:14 +0200 Subject: [PATCH] =?UTF-8?q?[#169]=20=E2=80=93=20Move=20email=20'from'=20&?= =?UTF-8?q?=20'host'=20settings=20to=20config=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/notify.rb | 10 +++++----- config/email.yml | 1 + config/initializers/load_config.rb | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 config/email.yml diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 56e4de9b..26a06402 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -5,7 +5,7 @@ class Notify < ActionMailer::Base def new_user_email(user, password) @user = user @password = password - mail(:to => @user.email, :subject => "gitlab | Account was created for you") + mail(:to => @user.email, :subject => "gitlab | Account was created for you", :from => EMAIL_OPTS["from"]) end def new_issue_email(issue) @@ -13,14 +13,14 @@ class Notify < ActionMailer::Base @project = issue.project @issue = issue - mail(:to => @user.email, :subject => "gitlab | New Issue was created") + mail(:to => @user.email, :subject => "gitlab | New Issue was created", :from => EMAIL_OPTS["from"]) end def note_wall_email(user, note) @user = user @note = note @project = note.project - mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ") + mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ", :from => EMAIL_OPTS["from"]) end def note_commit_email(user, note) @@ -28,7 +28,7 @@ class Notify < ActionMailer::Base @note = note @project = note.project @commit = @project.repo.commits(note.noteable_id).first - mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ") + mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ", :from => EMAIL_OPTS["from"]) end def note_issue_email(user, note) @@ -36,6 +36,6 @@ class Notify < ActionMailer::Base @note = note @project = note.project @issue = note.noteable - mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ") + mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ", :from => EMAIL_OPTS["from"]) end end diff --git a/config/email.yml b/config/email.yml new file mode 100644 index 00000000..a763e100 --- /dev/null +++ b/config/email.yml @@ -0,0 +1 @@ +from: notify@gitlabhq.com diff --git a/config/initializers/load_config.rb b/config/initializers/load_config.rb index 6c7289e0..60f8515e 100644 --- a/config/initializers/load_config.rb +++ b/config/initializers/load_config.rb @@ -1 +1,2 @@ GITOSIS = YAML.load_file("#{Rails.root}/config/gitosis.yml") +EMAIL_OPTS = YAML.load_file("#{Rails.root}/config/email.yml")