aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Räty <petsku@petteriraty.eu>2010-07-13 10:43:12 +0300
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-07-29 19:49:16 +0200
commit85927a805e76911b436a75533f94f5a451010c3f (patch)
treea937e5c99736ec1a3114cb366d7d3e2a4efaa937
parentEmail questions (diff)
downloadrecruiting-webapp-85927a805e76911b436a75533f94f5a451010c3f.tar.gz
recruiting-webapp-85927a805e76911b436a75533f94f5a451010c3f.tar.bz2
recruiting-webapp-85927a805e76911b436a75533f94f5a451010c3f.zip
Add ability to receive emails through HTTP
./script/runner is a bit slow as it loads the Rails env each time and it's also a bit of pain to setup permission wise for development.
-rw-r--r--app/controllers/users_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 433386c..5903ce8 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -20,4 +20,12 @@ class UsersController < ApplicationController
@user = this
end
end
+
+ skip_before_filter :verify_authenticity_token, :only => [:receive_email]
+
+ def receive_email
+ raise Hobo::PermissionDeniedError unless request.remote_ip == '127.0.0.1'
+ UserMailer.receive(params[:email])
+ render :text => 'Email Received'
+ end
end