diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-25 16:05:45 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-25 16:20:35 +0300 |
commit | e0c186c35735a2dc9e05e88ad9975ae016c815d9 (patch) | |
tree | c040a133925106da34de651cb88e155988a079fc /app/models/project_services/emails_on_push_service.rb | |
parent | 0e7d1fd44f057c83c5384618f4599271f9fdd006 (diff) |
Add option to send EmailsOnPush from committer email if domain matches.
See #1809.
Diffstat (limited to 'app/models/project_services/emails_on_push_service.rb')
-rw-r--r-- | app/models/project_services/emails_on_push_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/project_services/emails_on_push_service.rb b/app/models/project_services/emails_on_push_service.rb index 86693ad0c7e..a5653665bfb 100644 --- a/app/models/project_services/emails_on_push_service.rb +++ b/app/models/project_services/emails_on_push_service.rb @@ -14,6 +14,7 @@ # class EmailsOnPushService < Service + prop_accessor :send_from_committer_email prop_accessor :recipients validates :recipients, presence: true, if: :activated? @@ -29,12 +30,17 @@ class EmailsOnPushService < Service 'emails_on_push' end + def send_from_committer_email? + self.send_from_committer_email == "1" + end + def execute(push_data) - EmailsOnPushWorker.perform_async(project_id, recipients, push_data) + EmailsOnPushWorker.perform_async(project_id, recipients, push_data, self.send_from_committer_email?) end def fields [ + { type: 'checkbox', name: 'send_from_committer_email', title: "Send from committer email if domain matches" }, { type: 'textarea', name: 'recipients', placeholder: 'Emails separated by whitespace' }, ] end |