class Notify < ActionMailer::Base
+ include Resque::Mailer
add_template_helper ApplicationHelper
default_url_options[:host] = EMAIL_OPTS["host"]
def new_user_email(user, password)
@user = user
@password = password
- mail(:to => @user.email, :subject => "gitlab | Account was created for you")
+ mail(:to => @user['email'], :subject => "gitlab | Account was created for you")
end
def new_issue_email(issue)
- @user = issue.assignee
- @project = issue.project
- @issue = issue
+ @issue = Issue.find(issue['id'])
+ @user = @issue.assignee
+ @project = @issue.project
mail(:to => @user.email, :subject => "gitlab | New Issue was created")
end
def note_wall_email(user, note)
@user = user
- @note = note
- @project = note.project
- mail(:to => @user.email, :subject => "gitlab | #{@note.project.name} ")
+ @note = Note.find(note['id'])
+ @project = @note.project
+ mail(:to => @user['email'], :subject => "gitlab | #{@note.project.name} ")
end
def note_commit_email(user, note)
@user = user
- @note = note
- @project = note.project
+ @note = Note.find(note['id'])
+ @project = @note.project
@commit = @note.target
- mail(:to => @user.email, :subject => "gitlab | note for commit | #{@note.project.name} ")
+ mail(:to => @user['email'], :subject => "gitlab | note for commit | #{@note.project.name} ")
end
def note_merge_request_email(user, note)
@user = user
- @note = note
- @project = note.project
- @merge_request = note.noteable
- mail(:to => @user.email, :subject => "gitlab | note for merge request | #{@note.project.name} ")
+ @note = Note.find(note['id'])
+ @project = @note.project
+ @merge_request = @note.noteable
+ mail(:to => @user['email'], :subject => "gitlab | note for merge request | #{@note.project.name} ")
end
def note_issue_email(user, note)
@user = user
- @note = note
- @project = note.project
- @issue = note.noteable
- mail(:to => @user.email, :subject => "gitlab | note for issue #{@issue.id} | #{@note.project.name} ")
+ @note = Note.find(note['id'])
+ @project = @note.project
+ @issue = @note.noteable
+ mail(:to => @user['email'], :subject => "gitlab | note for issue #{@issue.id} | #{@note.project.name} ")
end
def new_merge_request_email(merge_request)
- @user = merge_request.assignee
- @merge_request = merge_request
- @project = merge_request.project
+ @merge_request = MergeRequest.find(merge_request['id'])
+ @user = @merge_request.assignee
+ @project = @merge_request.project
mail(:to => @user.email, :subject => "gitlab | new merge request | #{@merge_request.title} ")
end
def changed_merge_request_email(user, merge_request)
@user = user
- @assignee_was ||= User.find(merge_request.assignee_id_was)
- @merge_request = merge_request
- @project = merge_request.project
- mail(:to => @user.email, :subject => "gitlab | merge request changed | #{@merge_request.title} ")
+ @merge_request = MergeRequest(merge_request.id)
+ @assignee_was ||= User.find(@merge_request.assignee_id_was)
+ @project = @merge_request.project
+ mail(:to => @user['email'], :subject => "gitlab | merge request changed | #{@merge_request.title} ")
end
def changed_issue_email(user, issue)
+ @issue = Issue.find(issue['id'])
@user = user
- @assignee_was ||= User.find(issue.assignee_id_was)
- @issue = issue
- @project = issue.project
- mail(:to => @user.email, :subject => "gitlab | changed issue | #{@issue.title} ")
+ @assignee_was ||= User.find(@issue.assignee_id_was)
+ @project = @issue.project
+ mail(:to => @user['email'], :subject => "gitlab | changed issue | #{@issue.title} ")
end
end
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%td{:align => "left", :style => "padding: 20px 0 0;"}
%h2{:style => "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
- Hi #{@user.name}!
+ Hi #{@user['name']}!
%p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "}
Administrator created account for you. Now you are a member of company gitlab application.
%td{:style => "font-size: 1px; line-height: 1px;", :width => "21"}
%td{:style => "padding: 15px 0 15px;", :valign => "top"}
%p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "}
login..........................................
- %code= @user.email
+ %code= @user['email']
%p{:style => "color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 28px; font-size: 16px;font-family: Helvetica, Arial, sans-serif; "}
password..................................
%code= @password