diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-09 08:44:05 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-09 08:44:05 +0300 |
commit | 71bd9568669d18bc04c551a603a04af2ea99328c (patch) | |
tree | 1ae9e5d5564239a48dd6da6c0c577192e43251c9 /app | |
parent | c7bb3a1f726be189ccce51bdd631b26eb4f64db1 (diff) | |
download | gitlab-ce-71bd9568669d18bc04c551a603a04af2ea99328c.tar.gz |
email via sidekiq. start and stop rake tasks
Diffstat (limited to 'app')
-rw-r--r-- | app/mailers/notify.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/observers/issue_observer.rb | 6 | ||||
-rw-r--r-- | app/observers/merge_request_observer.rb | 4 | ||||
-rw-r--r-- | app/observers/note_observer.rb | 4 | ||||
-rw-r--r-- | app/observers/user_observer.rb | 2 | ||||
-rw-r--r-- | app/observers/users_project_observer.rb | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 87d3e4b204e..c672940a05e 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -1,5 +1,5 @@ class Notify < ActionMailer::Base - include Sidekiq::Mailer + add_template_helper ApplicationHelper add_template_helper GitlabMarkdownHelper diff --git a/app/models/project.rb b/app/models/project.rb index 702f4b2bf81..32b951349a9 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -251,7 +251,7 @@ class Project < ActiveRecord::Base def send_move_instructions self.users_projects.each do |member| - Notify.project_was_moved_email(member.id).deliver + Notify.delay.project_was_moved_email(member.id) end end diff --git a/app/observers/issue_observer.rb b/app/observers/issue_observer.rb index 131336be8b6..262d0f892c4 100644 --- a/app/observers/issue_observer.rb +++ b/app/observers/issue_observer.rb @@ -3,7 +3,7 @@ class IssueObserver < ActiveRecord::Observer def after_create(issue) if issue.assignee && issue.assignee != current_user - Notify.new_issue_email(issue.id).deliver + Notify.delay.new_issue_email(issue.id) end end @@ -16,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer if status Note.create_status_change_note(issue, current_user, status) [issue.author, issue.assignee].compact.each do |recipient| - Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user.id).deliver + Notify.delay.issue_status_changed_email(recipient.id, issue.id, status, current_user.id) end end end @@ -27,7 +27,7 @@ class IssueObserver < ActiveRecord::Observer recipient_ids = [issue.assignee_id, issue.assignee_id_was].keep_if {|id| id && id != current_user.id } recipient_ids.each do |recipient_id| - Notify.reassigned_issue_email(recipient_id, issue.id, issue.assignee_id_was).deliver + Notify.delay.reassigned_issue_email(recipient_id, issue.id, issue.assignee_id_was) end end end diff --git a/app/observers/merge_request_observer.rb b/app/observers/merge_request_observer.rb index c4040f1542d..6d3c2bdd186 100644 --- a/app/observers/merge_request_observer.rb +++ b/app/observers/merge_request_observer.rb @@ -3,7 +3,7 @@ class MergeRequestObserver < ActiveRecord::Observer def after_create(merge_request) if merge_request.assignee && merge_request.assignee != current_user - Notify.new_merge_request_email(merge_request.id).deliver + Notify.delay.new_merge_request_email(merge_request.id) end end @@ -25,7 +25,7 @@ class MergeRequestObserver < ActiveRecord::Observer recipients_ids.delete current_user.id recipients_ids.each do |recipient_id| - Notify.reassigned_merge_request_email(recipient_id, merge_request.id, merge_request.assignee_id_was).deliver + Notify.delay.reassigned_merge_request_email(recipient_id, merge_request.id, merge_request.assignee_id_was) end end end diff --git a/app/observers/note_observer.rb b/app/observers/note_observer.rb index fe01efcaac2..3f6d1dfcb70 100644 --- a/app/observers/note_observer.rb +++ b/app/observers/note_observer.rb @@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer notify_team(note) elsif note.notify_author # Notify only author of resource - Notify.note_commit_email(note.commit_author.id, note.id).deliver + Notify.delay.note_commit_email(note.commit_author.id, note.id) else # Otherwise ignore it nil @@ -26,7 +26,7 @@ class NoteObserver < ActiveRecord::Observer if Notify.respond_to? notify_method team_without_note_author(note).map do |u| - Notify.send(notify_method, u.id, note.id).deliver + Notify.delay.send(notify_method, u.id, note.id) end end end diff --git a/app/observers/user_observer.rb b/app/observers/user_observer.rb index 73a1d00ca3b..c1179ed7881 100644 --- a/app/observers/user_observer.rb +++ b/app/observers/user_observer.rb @@ -2,7 +2,7 @@ class UserObserver < ActiveRecord::Observer def after_create(user) log_info("User \"#{user.name}\" (#{user.email}) was created") - Notify.new_user_email(user.id, user.password).deliver + Notify.delay.new_user_email(user.id, user.password) end def after_destroy user diff --git a/app/observers/users_project_observer.rb b/app/observers/users_project_observer.rb index 0c9c2b2614a..b969d6a13ef 100644 --- a/app/observers/users_project_observer.rb +++ b/app/observers/users_project_observer.rb @@ -1,7 +1,7 @@ class UsersProjectObserver < ActiveRecord::Observer def after_commit(users_project) return if users_project.destroyed? - Notify.project_access_granted_email(users_project.id).deliver + Notify.delay.project_access_granted_email(users_project.id) end def after_create(users_project) |