mandrill 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +1 -0
- data/README.rdoc +25 -22
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/mandrill.gemspec +5 -4
- metadata +22 -21
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm: 1.9.3
|
data/README.rdoc
CHANGED
@@ -8,11 +8,34 @@ Mandrill is a Ruby gem that provides a wrapper for interacting with the {Mandril
|
|
8
8
|
|
9
9
|
== Usage
|
10
10
|
|
11
|
-
|
11
|
+
=== Interacting with the API
|
12
|
+
|
13
|
+
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:
|
14
|
+
|
15
|
+
m = Mandrill::API.new('api-key')
|
16
|
+
m.users :ping
|
17
|
+
m.users :senders
|
18
|
+
# Methods with dashes shouldn't be passed in as symbols
|
19
|
+
m.users 'disable-sender', {:domain => "exampledomain.com"}
|
20
|
+
m.users 'verify-sender', {:email => 'test@exampledomain.com'}
|
21
|
+
m.messages :send {:message => {:html => "HTML message text", :text => "message text"}...}
|
22
|
+
|
23
|
+
=== Errors
|
24
|
+
|
25
|
+
When an error is received an instance of <code>Mandrill::API::Error</code> will be returned so that you can rescue accordingly:
|
26
|
+
|
27
|
+
rescue Mandrill::API::Error > error
|
28
|
+
...
|
29
|
+
|
30
|
+
== OAuth
|
31
|
+
|
32
|
+
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...
|
33
|
+
|
34
|
+
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.
|
12
35
|
|
13
36
|
=== Register Your App
|
14
37
|
|
15
|
-
{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",
|
38
|
+
{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.
|
16
39
|
|
17
40
|
=== Connect Your App
|
18
41
|
|
@@ -36,26 +59,6 @@ Once authorized successfully, a POST request will be sent to the +redirect_url+
|
|
36
59
|
|
37
60
|
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.
|
38
61
|
|
39
|
-
|
40
|
-
=== Interacting with the API
|
41
|
-
|
42
|
-
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:
|
43
|
-
|
44
|
-
m = Mandrill::API.new('api-key')
|
45
|
-
m.users :ping
|
46
|
-
m.users :senders
|
47
|
-
# Methods with dashes shouldn't be passed in as symbols
|
48
|
-
m.users 'disable-sender', {:domain => "exampledomain.com"}
|
49
|
-
m.users 'verify-sender', {:email => 'test@exampledomain.com'}
|
50
|
-
m.messages :send {:message => {:html => "HTML message text", :text => "message text"}...}
|
51
|
-
|
52
|
-
=== Errors
|
53
|
-
|
54
|
-
When an error is received an instance of <code>Mandrill::API::Error</code> will be returned so that you can rescue accordingly:
|
55
|
-
|
56
|
-
rescue Mandrill::API::Error > error
|
57
|
-
...
|
58
|
-
|
59
62
|
== Contributing to Mandrill
|
60
63
|
|
61
64
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
data/Rakefile
CHANGED
@@ -15,11 +15,11 @@ require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = "mandrill"
|
18
|
-
gem.homepage = "http://github.com/
|
18
|
+
gem.homepage = "http://github.com/tatemae-consultancy/mandrill"
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = %Q{Ruby gem for interacting with the Mandrill API.}
|
21
21
|
gem.description = %Q{Ruby gem for interacting with the Mandrill API.}
|
22
|
-
gem.email = "brian@
|
22
|
+
gem.email = "brian@tatem.ae"
|
23
23
|
gem.authors = ["Brian Getting"]
|
24
24
|
# dependencies defined in Gemfile
|
25
25
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/mandrill.gemspec
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mandrill"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Getting"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-08-02"
|
13
13
|
s.description = "Ruby gem for interacting with the Mandrill API."
|
14
|
-
s.email = "brian@
|
14
|
+
s.email = "brian@tatem.ae"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.rdoc"
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
".document",
|
21
21
|
".rspec",
|
22
22
|
".rvmrc",
|
23
|
+
".travis.yml",
|
23
24
|
"Gemfile",
|
24
25
|
"Gemfile.lock",
|
25
26
|
"Guardfile",
|
@@ -34,7 +35,7 @@ Gem::Specification.new do |s|
|
|
34
35
|
"spec/mandrill/mandrill_spec.rb",
|
35
36
|
"spec/spec_helper.rb"
|
36
37
|
]
|
37
|
-
s.homepage = "http://github.com/
|
38
|
+
s.homepage = "http://github.com/tatemae-consultancy/mandrill"
|
38
39
|
s.licenses = ["MIT"]
|
39
40
|
s.require_paths = ["lib"]
|
40
41
|
s.rubygems_version = "1.8.10"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mandrill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpi
|
16
|
-
requirement: &
|
16
|
+
requirement: &70127401230500 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70127401230500
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &70127401229040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70127401229040
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70127401228460 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70127401228460
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: fakeweb
|
49
|
-
requirement: &
|
49
|
+
requirement: &70127401227800 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.3.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70127401227800
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: guard-rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &70127401227200 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.7.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70127401227200
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &70127401226460 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.8.3
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70127401226460
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov
|
82
|
-
requirement: &
|
82
|
+
requirement: &70127401225600 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.6.1
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70127401225600
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rspec
|
93
|
-
requirement: &
|
93
|
+
requirement: &70127401224780 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,9 +98,9 @@ dependencies:
|
|
98
98
|
version: 2.8.0
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70127401224780
|
102
102
|
description: Ruby gem for interacting with the Mandrill API.
|
103
|
-
email: brian@
|
103
|
+
email: brian@tatem.ae
|
104
104
|
executables: []
|
105
105
|
extensions: []
|
106
106
|
extra_rdoc_files:
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- .document
|
111
111
|
- .rspec
|
112
112
|
- .rvmrc
|
113
|
+
- .travis.yml
|
113
114
|
- Gemfile
|
114
115
|
- Gemfile.lock
|
115
116
|
- Guardfile
|
@@ -123,7 +124,7 @@ files:
|
|
123
124
|
- spec/mandrill/fixtures/error.json
|
124
125
|
- spec/mandrill/mandrill_spec.rb
|
125
126
|
- spec/spec_helper.rb
|
126
|
-
homepage: http://github.com/
|
127
|
+
homepage: http://github.com/tatemae-consultancy/mandrill
|
127
128
|
licenses:
|
128
129
|
- MIT
|
129
130
|
post_install_message:
|
@@ -138,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
139
|
version: '0'
|
139
140
|
segments:
|
140
141
|
- 0
|
141
|
-
hash:
|
142
|
+
hash: 2998997965792520502
|
142
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
144
|
none: false
|
144
145
|
requirements:
|