debian-mirror-gitlab/app/mailers/emails/projects.rb

43 lines
1.4 KiB
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
module Emails
module Projects
2015-10-24 18:46:33 +05:30
def project_was_moved_email(project_id, user_id, old_path_with_namespace)
2015-04-26 12:48:37 +05:30
@current_user = @user = User.find user_id
2014-09-02 18:07:02 +05:30
@project = Project.find project_id
2017-09-10 17:25:29 +05:30
@target_url = project_url(@project)
2015-10-24 18:46:33 +05:30
@old_path_with_namespace = old_path_with_namespace
2015-04-26 12:48:37 +05:30
mail(to: @user.notification_email,
2014-09-02 18:07:02 +05:30
subject: subject("Project was moved"))
end
2016-06-22 15:30:34 +05:30
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-06-02 11:05:42 +05:30
def repository_push_email(project_id, opts = {})
2015-12-23 02:04:40 +05:30
@message =
2016-06-02 11:05:42 +05:30
Gitlab::Email::Message::RepositoryPush.new(self, project_id, opts)
2015-04-26 12:48:37 +05:30
2015-12-23 02:04:40 +05:30
# used in notify layout
@target_url = @message.target_url
2016-06-02 11:05:42 +05:30
@project = Project.find(project_id)
@diff_notes_disabled = true
2016-01-29 22:53:50 +05:30
add_project_headers
headers['X-GitLab-Author'] = @message.author_username
2015-12-23 02:04:40 +05:30
mail(from: sender(@message.author_id, @message.send_from_committer_email?),
reply_to: @message.reply_to,
subject: @message.subject)
2014-09-02 18:07:02 +05:30
end
end
end