2013-03-19 18:00:41 +00:00
|
|
|
module Emails
|
|
|
|
module Projects
|
2015-09-29 13:37:50 +00:00
|
|
|
def project_was_moved_email(project_id, user_id, old_path_with_namespace)
|
2015-03-27 11:58:23 +00:00
|
|
|
@current_user = @user = User.find user_id
|
2013-06-22 07:56:51 +00:00
|
|
|
@project = Project.find project_id
|
2017-06-29 17:06:35 +00:00
|
|
|
@target_url = project_url(@project)
|
2015-09-29 13:37:50 +00:00
|
|
|
@old_path_with_namespace = old_path_with_namespace
|
2015-02-06 23:23:58 +00:00
|
|
|
mail(to: @user.notification_email,
|
2013-11-08 15:04:36 +00:00
|
|
|
subject: subject("Project was moved"))
|
2015-04-10 14:37:02 +00:00
|
|
|
end
|
|
|
|
|
2016-06-14 14:31:03 +00:00
|
|
|
def project_was_exported_email(current_user, project)
|
|
|
|
@project = project
|
|
|
|
mail(to: current_user.notification_email,
|
|
|
|
subject: subject("Project was exported"))
|
|
|
|
end
|
|
|
|
|
|
|
|
def project_was_not_exported_email(current_user, project, errors)
|
|
|
|
@project = project
|
|
|
|
@errors = errors
|
|
|
|
mail(to: current_user.notification_email,
|
|
|
|
subject: subject("Project export error"))
|
|
|
|
end
|
|
|
|
|
2016-05-06 12:16:53 +00:00
|
|
|
def repository_push_email(project_id, opts = {})
|
2015-11-21 19:54:19 +00:00
|
|
|
@message =
|
2016-05-06 12:16:53 +00:00
|
|
|
Gitlab::Email::Message::RepositoryPush.new(self, project_id, opts)
|
2015-11-18 09:13:34 +00:00
|
|
|
|
2015-11-23 20:25:49 +00:00
|
|
|
# used in notify layout
|
|
|
|
@target_url = @message.target_url
|
2016-05-12 15:06:14 +00:00
|
|
|
@project = Project.find(project_id)
|
|
|
|
@diff_notes_disabled = true
|
2015-12-19 19:04:40 +00:00
|
|
|
|
|
|
|
add_project_headers
|
|
|
|
headers['X-GitLab-Author'] = @message.author_username
|
2015-11-23 20:25:49 +00:00
|
|
|
|
2015-11-21 19:54:19 +00:00
|
|
|
mail(from: sender(@message.author_id, @message.send_from_committer_email?),
|
|
|
|
reply_to: @message.reply_to,
|
|
|
|
subject: @message.subject)
|
2013-12-17 12:45:55 +00:00
|
|
|
end
|
2013-03-19 18:00:41 +00:00
|
|
|
end
|
|
|
|
end
|