inbox 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -1
  3. data/lib/inbox.rb +6 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 988d96866a7e23dfbb209bfe7591ba7b2ef82c9b
4
- data.tar.gz: f41538e8fdc548860f0f8e60c9bf67f6145b7268
3
+ metadata.gz: 1accdd1e51e6151899d73c573098902b1ee46356
4
+ data.tar.gz: ec98af89dabbfec85638a91a9fc436d97398db8e
5
5
  SHA512:
6
- metadata.gz: f06646c4428a45c811ef7ac522012837e64215ca28aedf08d51a5959ab0c5ea11d2fced6d7a6e82b7d50d562dae860b0593484c3a379b0097216f70f9f359769
7
- data.tar.gz: 33044f340f3b68070de735ba4e85bf7846f29a3e385d720bd65f61e9ec6d739fae311c6c2282bc2c1be99b92d3cab7217bae8a5d5d6498523091f592e0dbeef5
6
+ metadata.gz: 736d52441c42352ff436525f3d3321baf5a29070f0c0571586b9359a98518da58afcf8aa07b8b7502484da5e57afe0749bf41d5f786c993a6e59572cc741e2a4
7
+ data.tar.gz: 78dd66327d6fff5514fadc9258a0e7cc4ffdef0cc182744eeff77d2a684e75ce84022c838701a734b640590a793fe9f3b68382aabae6736084ca366444ca8eec
data/README.md CHANGED
@@ -75,7 +75,16 @@ end
75
75
 
76
76
  ### Managing Billing
77
77
 
78
- If you're using the open-source version of the Inbox API or have fewer than 100 accounts associated with your developer app, you don't need to worry about billing. However, if you've requested production access to the Inbox API, you are billed monthly based on the number of email accounts you've connected to Inbox. Accounts initially start in a "trial" state and sync slowly at a rate of one message per minute so users can try out your app. After 30 days, you need to upgrade accounts (and start paying for them) or they will automatically expire. You may wish to upgrade accounts earlier to dramatically speed up the mail sync progress depending on your app's needs.
78
+ If you're using the open-source version of the Inbox API or have fewer than 100 accounts associated with your developer app, you don't need to worry about billing. However, if you've requested production access to the Inbox API, you are billed monthly based on the number of email accounts you've connected to Inbox. You can choose to start accounts in "trial" state and sync slowly at a rate of one message per minute so users can try out your app. If you use trial mode, you need to upgrade accounts (and start paying for them) within 30 days or they will automatically expire. You may wish to upgrade accounts earlier to dramatically speed up the mail sync progress depending on your app's needs.
79
+
80
+ **Starting an Account in Trial Mode**
81
+
82
+ When you're redirecting the user to Inbox to authenticate with their email provider,
83
+ pass the additional `trial: true` option to start their account in trial mode.
84
+
85
+ ```ruby
86
+ redirect_to inbox.url_for_authentication(callback_url, user_email, {trial: true})
87
+ ```
79
88
 
80
89
  **Upgrading an Account**
81
90
 
data/lib/inbox.rb CHANGED
@@ -62,8 +62,12 @@ module Inbox
62
62
  "#{protocol}//#{@access_token}:@#{domain}#{path}"
63
63
  end
64
64
 
65
- def url_for_authentication(redirect_uri, login_hint = '')
66
- "https://www.inboxapp.com/oauth/authorize?client_id=#{@app_id}&response_type=code&scope=email&login_hint=#{login_hint}&redirect_uri=#{redirect_uri}"
65
+ def url_for_authentication(redirect_uri, login_hint = '', options = {})
66
+ trialString = 'false'
67
+ if options[:trial] == true
68
+ trialString = 'true'
69
+ end
70
+ "https://www.inboxapp.com/oauth/authorize?client_id=#{@app_id}&trial=#{trialString}&response_type=code&scope=email&login_hint=#{login_hint}&redirect_uri=#{redirect_uri}"
67
71
  end
68
72
 
69
73
  def set_access_token(token)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Gotow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client