Browse files

adding Errno::ECONNREFUSED execption handling, updating readme

  • Loading branch information...
1 parent 181fe9f commit bcb5c6c16d16c66cc295b8f4d9da931e501733b2 @GBH GBH committed Nov 15, 2011
Showing with 7 additions and 1 deletion.
  1. +6 −0 README.md
  2. +1 −1 lib/postageapp/request.rb
View
6 README.md
@@ -94,6 +94,12 @@ You can quickly convert your existing mailers to use PostageApp service by simpl
There are custom methods that allow setting of `template` and `variables` parts of the API call. They are `postageapp_template` and `postageapp_variables`. Examples how they are used are below. For details what they do please see [documentation](http://help.postageapp.com/faqs)
+Please note that `deliver` method will return `PostageApp::Response` object. This way you can immediately check the status of the delivery. For example:
+
+ >> response = UserMailer.welcome_email(@user).deliver
+ >> response.ok?
+ => true
+
### Rails 3.x
Here's an example of a mailer in Rails 3 environment:
View
2 lib/postageapp/request.rb
@@ -45,7 +45,7 @@ def send(skip_failed_requests_processing = false)
self.arguments_to_send.to_json,
HEADERS.merge('User-Agent' => "PostageApp-RubyGem #{PostageApp::VERSION} (Ruby #{RUBY_VERSION}, #{PostageApp.configuration.framework})")
)
- rescue TimeoutError
+ rescue TimeoutError, Errno::ECONNREFUSED
nil
end

0 comments on commit bcb5c6c

Please sign in to comment.