gitlabhq/app/mailers/notify.rb

42 lines
1.1 KiB
Ruby
Raw Normal View History

2011-10-08 23:36:38 +02:00
class Notify < ActionMailer::Base
2011-11-25 19:50:27 +01:00
default_url_options[:host] = EMAIL_OPTS["host"]
default from: EMAIL_OPTS["from"]
2011-10-08 23:36:38 +02:00
def new_user_email(user, password)
@user = user
@password = password
2011-11-25 19:50:27 +01:00
mail(:to => @user.email, :subject => "gitlab | Account was created for you")
2011-10-08 23:36:38 +02:00
end
def new_issue_email(issue)
@user = issue.assignee
@project = issue.project
@issue = issue
2011-11-25 19:50:27 +01:00
mail(:to => @user.email, :subject => "gitlab | New Issue was created")
2011-10-08 23:36:38 +02:00
end
def note_wall_email(user, note)
@user = user
@note = note
@project = note.project
2011-11-25 19:50:27 +01:00
mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ")
2011-10-08 23:36:38 +02:00
end
def note_commit_email(user, note)
@user = user
@note = note
@project = note.project
@commit = @project.repo.commits(note.noteable_id).first
2011-11-25 19:50:27 +01:00
mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ")
2011-10-08 23:36:38 +02:00
end
def note_issue_email(user, note)
@user = user
@note = note
@project = note.project
@issue = note.noteable
2011-11-25 19:50:27 +01:00
mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ")
2011-10-08 23:36:38 +02:00
end
end