diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-10 16:37:02 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-14 12:08:11 +0200 |
commit | e50556fcc8d81dae5978bcb3e1dd5104789aab0f (patch) | |
tree | 000c94f5da8061efa360c0e580e77261de84e8b1 /app/mailers | |
parent | 8949af0c9f2aa90b979043a0a6ee264ac0c036b9 (diff) | |
download | gitlab-ce-e50556fcc8d81dae5978bcb3e1dd5104789aab0f.tar.gz |
Let invites be declined.
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/groups.rb | 13 | ||||
-rw-r--r-- | app/mailers/emails/projects.rb | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/app/mailers/emails/groups.rb b/app/mailers/emails/groups.rb index 9db609006e0..f3da3990c5f 100644 --- a/app/mailers/emails/groups.rb +++ b/app/mailers/emails/groups.rb @@ -27,5 +27,18 @@ module Emails mail(to: @group_member.created_by.notification_email, subject: subject("Invite accepted")) end + + def group_invite_declined_email(group_id, invite_email, access_level, created_by_id) + return if created_by_id.nil? + + @group = Group.find(group_id) + @created_by = User.find(created_by_id) + @access_level = access_level + @invite_email = invite_email + @target_url = group_url(@group) + + mail(to: @created_by.notification_email, + subject: subject("Invite declined")) + end end end diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb index 64c35618a52..bbfb7a3e409 100644 --- a/app/mailers/emails/projects.rb +++ b/app/mailers/emails/projects.rb @@ -28,6 +28,19 @@ module Emails subject: subject("Invite accepted")) end + def project_invite_declined_email(project_id, invite_email, access_level, created_by_id) + return if created_by_id.nil? + + @project = Project.find(project_id) + @created_by = User.find(created_by_id) + @access_level = access_level + @invite_email = invite_email + @target_url = namespace_project_url(@project.namespace, @project) + + mail(to: @created_by.notification_email, + subject: subject("Invite declined")) + end + def project_was_moved_email(project_id, user_id) @current_user = @user = User.find user_id @project = Project.find project_id |