README.rdoc in mandrill-0.0.1 vs README.rdoc in mandrill-0.0.2

- old
+ new

@@ -6,15 +6,38 @@ (sudo) gem install mandrill == Usage -To start with, you will need a {Mandrill account}[http://help.mandrill.com/customer/portal/articles/456476-setup-and-general-information] as a developer so that you can register your app. People that want to use your application will also need to a {create a Mandrill account}[http://help.mandrill.com/customer/portal/articles/456476-setup-and-general-information] (obviously) as well. +=== Interacting with the API +Once you have a valid API key (either your {account password}[https://mandrillapp.com/settings] or OAuth token) you can easily interact with the {Mandrill API}[http://mandrillapp.com/api/docs/index.html] by passing in arguments as a hash: + + m = Mandrill::API.new('api-key') + m.users :ping + m.users :senders + # Methods with dashes shouldn't be passed in as symbols + m.users 'disable-sender', {:domain => "exampledomain.com"} + m.users 'verify-sender', {:email => 'test@exampledomain.com'} + m.messages :send {:message => {:html => "HTML message text", :text => "message text"}...} + +=== Errors + +When an error is received an instance of <code>Mandrill::API::Error</code> will be returned so that you can rescue accordingly: + + rescue Mandrill::API::Error > error + ... + +== OAuth + +This is for advanced users only! Most (> 99%) developers will only care about the API, and that is entirely handled by the description above. OAuth support is only for companies building an email-oriented service who would like to do so atop Mandrill. If this is you, read on... + +You will need a {Mandrill account}[http://help.mandrill.com/customer/portal/topics/214457-getting-started/articles] as a developer so that you can register your app. + === Register Your App -{Login to your Mandrill account}[https://mandrillapp.com] and click "{register a new app}[https://mandrillapp.com/app/register]" on the "Settings > Applications" page. Once your app is registered, you will get an "App Authentication ID", which we refer to in this document at the "App ID". You're now ready to get started. +{Login to your Mandrill account}[https://mandrillapp.com] and click "{register a new app}[https://mandrillapp.com/app/register]" on the "Settings > Applications" page. Once your app is registered, you will get an "App Authentication ID", and you're now ready to get started. === Connect Your App The first thing you will need to do is prompt your users to authorize the connection between your application and {Mandrill}[https://mandrillapp.com]. Once they are logged in, simply redirect them: @@ -33,29 +56,9 @@ ... end end As you can see, we are saving the key that Mandrill returns for the currently logged in user, and we have successfully connected this user account to Mandrill. - - -=== Interacting with the API - -Once you have a valid API key (your own {account password}[https://mandrillapp.com/settings] works) you can easily interact with the {Mandrill API}[http://mandrillapp.com/api/docs/index.html] by passing in a hash: - - m = Mandrill::API.new('api-key') - m.users :ping - m.users :senders - # Methods with dashes shouldn't be passed in as symbols - m.users 'disable-sender', {:domain => "exampledomain.com"} - m.users 'verify-sender', {:email => 'test@exampledomain.com'} - m.messages :send {:message => {:html => "HTML message text", :text => "message text"}...} - -=== Errors - -When an error is received an instance of <code>Mandrill::API::Error</code> will be returned so that you can rescue accordingly: - - rescue Mandrill::API::Error > error - ... == Contributing to Mandrill * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet. * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.