Permalink
Browse files

Merge branch 'master' of https://github.com/eddietejeda/openup

  • Loading branch information...
2 parents c07fd4d + 67d4928 commit 5bea322e768c525c8ccc4939aba9e293b06754a3 @eddietejeda committed Jun 10, 2012
@@ -19,8 +19,7 @@ def create
if !@requester
@requester = Requester.create(params[:requester])
- #redirect_to root_path unless @requester.save
- render :text => @requester.errors.each { |e| e }
+ redirect_to root_path unless @requester.save
end
@request = @requester.requests.build(params[:request])
@@ -10,6 +10,7 @@ def create
@response = @request.responses.build(params[:response])
if @response.save
+ RequestMailer.response_sent_email(@response).deliver
redirect_to root_path
end
end
@@ -3,7 +3,12 @@ class RequestMailer < ActionMailer::Base
def request_sent_email(request)
@request = request
- @response_url = "http://www.google.com"
mail(to: @request.department.email, subject: "New FOI Request from OpenUp NYC")
end
+
+ def response_sent_email(response)
+ @response = response
+ mail(to: @response.request.requester.email, subject: "New Response from #{@response.request.department.name} on OpenUp NYC")
+ end
+
end
@@ -0,0 +1,7 @@
+Hey <%= @response.request.requester.name %>,
+
+You have a new response from <%= @response.request.department.name %> on OpenUp NYC.
+
+Click here to view it: <%= request_url(@response.request) %>
+
+-The OpenUp NYC Team

0 comments on commit 5bea322

Please sign in to comment.