summaryrefslogtreecommitdiff
path: root/app/services/notification_service.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-17 14:06:55 +0200
committerRémy Coutable <remy@rymai.me>2016-06-18 05:46:45 +0200
commit4652489f40a4ff2b749f9ad495986a7a17448243 (patch)
tree90a373da8bdbaf66bc0228abf8465d9d928c9f2e /app/services/notification_service.rb
parent00906b5bb6cde8cb60281109060a519a54000c61 (diff)
downloadgitlab-ce-4652489f40a4ff2b749f9ad495986a7a17448243.tar.gz
New Members::DestroyService
This is to ensure we don't send unwanted notifications when deleting a project. In other words, stop abusing AR callbacks and use services. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r--app/services/notification_service.rb21
1 files changed, 7 insertions, 14 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 19832a19b2b..590350a11e5 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -181,15 +181,16 @@ class NotificationService
end
end
- # Project access request
- def new_project_access_request(project_member)
- mailer.member_access_requested_email(project_member.real_source_type, project_member.id).deliver_later
+ # Members
+ def new_access_request(member)
+ mailer.member_access_requested_email(member.real_source_type, member.id).deliver_later
end
- def decline_project_access_request(project_member)
- mailer.member_access_denied_email(project_member.real_source_type, project_member.project.id, project_member.user.id).deliver_later
+ def decline_access_request(member)
+ mailer.member_access_denied_email(member.real_source_type, member.source_id, member.user_id).deliver_later
end
+ # Project invite
def invite_project_member(project_member, token)
mailer.member_invited_email(project_member.real_source_type, project_member.id, token).deliver_later
end
@@ -216,15 +217,7 @@ class NotificationService
mailer.member_access_granted_email(project_member.real_source_type, project_member.id).deliver_later
end
- # Group access request
- def new_group_access_request(group_member)
- mailer.member_access_requested_email(group_member.real_source_type, group_member.id).deliver_later
- end
-
- def decline_group_access_request(group_member)
- mailer.member_access_denied_email(group_member.real_source_type, group_member.group.id, group_member.user.id).deliver_later
- end
-
+ # Group invite
def invite_group_member(group_member, token)
mailer.member_invited_email(group_member.real_source_type, group_member.id, token).deliver_later
end