Skip to content

Commit

Permalink
Mail sent to mentor on proposal submission
Browse files Browse the repository at this point in the history
  • Loading branch information
reddragon committed Sep 20, 2010
1 parent 15e3cc1 commit 4d1d74d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/proposals_controller.rb
Expand Up @@ -65,6 +65,12 @@ def create
mentor_update.link_string = 'See the proposal'
mentor_update.link = project_proposal_url(@proposal.project, @proposal)
mentor_update.save

#Send an email to the mentor whenever a proposal is submitted
mail_subject = "Proposal for the project #{@proposal.project.name}"
mail_body = "Hi, #{current_user.login} has written a proposal for the project #{@proposal.project.name}:\n\n" + @proposal.proposal_text
Mail.deliver_message(@proposal.project.mentor.email, mail_subject, mail_body)

end

flash[:notice] = 'Your proposal was successfully created.'
Expand Down

0 comments on commit 4d1d74d

Please sign in to comment.