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