Skip to content
Snippets Groups Projects
Commit 3c13408f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets Committed by Wes Gurney
Browse files

Email templates when user was added to group

parent 4e0c57b7
No related branches found
No related tags found
1 merge request!4954Add support to configure webhook_timeout in gitlab.yaml
module Emails
module Groups
def group_access_granted_email(user_group_id)
@membership = UsersGroup.find(user_group_id)
@group = @membership.group
mail(to: @membership.user.email,
subject: subject("access to group was granted"))
end
end
end
module Emails
module Profile
def new_user_email(user_id, password)
@user = User.find(user_id)
@password = password
mail(to: @user.email, subject: subject("Account was created for you"))
end
def new_ssh_key_email(key_id)
@key = Key.find(key_id)
@user = @key.user
mail(to: @user.email, subject: subject("SSH key was added to your account"))
end
end
end
Loading
Loading
@@ -7,7 +7,6 @@ module Emails
subject: subject("access to project was granted"))
end
 
def project_was_moved_email(project_id, user_id)
@user = User.find user_id
@project = Project.find project_id
Loading
Loading
Loading
Loading
@@ -3,6 +3,8 @@ class Notify < ActionMailer::Base
include Emails::MergeRequests
include Emails::Notes
include Emails::Projects
include Emails::Profile
include Emails::Groups
 
add_template_helper ApplicationHelper
add_template_helper GitlabMarkdownHelper
Loading
Loading
@@ -20,18 +22,6 @@ class Notify < ActionMailer::Base
delay_for(2.seconds)
end
 
def new_user_email(user_id, password)
@user = User.find(user_id)
@password = password
mail(to: @user.email, subject: subject("Account was created for you"))
end
def new_ssh_key_email(key_id)
@key = Key.find(key_id)
@user = @key.user
mail(to: @user.email, subject: subject("SSH key was added to your account"))
end
private
 
# Look up a User by their ID and return their email address
Loading
Loading
%p
= "You have been granted #{@membership.human_access} access to group"
%p
= link_to group_url(@group) do
= @group.name
You have been granted <%= @membership.human_access %> access to group <%= @group.name %>
<%= url_for(group_url(@group)) %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment