postageapp 1.2.5 → 1.2.6
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.
- checksums.yaml +7 -0
- data/.travis.yml +19 -9
- data/README.md +12 -66
- data/doc/RAILS2.md +54 -0
- data/doc/RAILS3.md +15 -0
- data/lib/postageapp/mailer.rb +1 -0
- data/lib/postageapp/mailer/mailer_4.rb +3 -5
- data/lib/postageapp/version.rb +1 -1
- data/postageapp.gemspec +10 -9
- data/script/with +1 -1
- data/test/gemfiles/Gemfile.rails-5.0.x +13 -0
- data/test/gemfiles/Gemfile.ruby +1 -1
- metadata +16 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 87918c47d50e1751788cda27b312a59b3ee55b32
|
4
|
+
data.tar.gz: 983a6fe90bf14de8fa3772bb9f94abc00c0df4b9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5711ee6b20b410068969d9b5aa2dcda4089f8db04a64abb957f3b54f56ec7ea2a42d98cbb7a491b7ea795d4b488b03525def4019b4eeefccfaf70adaef55805
|
7
|
+
data.tar.gz: 7676cb2ff7e3b55b5c8d1f4efcd62ffffd149705694d918e18a7a9b4f5cd640f10fe281721da2a42458dfb45d581a970ee91a2e7fc0a336d5a0082a8449f05ee
|
data/.travis.yml
CHANGED
@@ -4,10 +4,11 @@ install: "WITH_VERBOSE=1 script/with current bundle install"
|
|
4
4
|
script: "WITH_VERBOSE=1 script/with current bundle exec rake test"
|
5
5
|
rvm:
|
6
6
|
- 1.9.3-p551
|
7
|
-
- 2.0.0-
|
8
|
-
- 2.1.
|
9
|
-
- 2.2.
|
10
|
-
- 2.3.
|
7
|
+
- 2.0.0-p648
|
8
|
+
- 2.1.10
|
9
|
+
- 2.2.5
|
10
|
+
- 2.3.1
|
11
|
+
- jruby-9.1.2.0
|
11
12
|
gemfile:
|
12
13
|
- test/gemfiles/Gemfile.ruby
|
13
14
|
- test/gemfiles/Gemfile.rails-2.3.x
|
@@ -17,17 +18,20 @@ gemfile:
|
|
17
18
|
- test/gemfiles/Gemfile.rails-4.0.x
|
18
19
|
- test/gemfiles/Gemfile.rails-4.1.x
|
19
20
|
- test/gemfiles/Gemfile.rails-4.2.x
|
21
|
+
- test/gemfiles/Gemfile.rails-5.0.x
|
20
22
|
matrix:
|
21
23
|
exclude:
|
22
|
-
- rvm:
|
24
|
+
- rvm: 1.9.3-p551
|
23
25
|
gemfile: test/gemfiles/Gemfile.rails-2.3.x
|
24
|
-
- rvm: 2.
|
26
|
+
- rvm: 2.0.0-p648
|
25
27
|
gemfile: test/gemfiles/Gemfile.rails-2.3.x
|
26
|
-
- rvm: 2.
|
28
|
+
- rvm: 2.1.10
|
27
29
|
gemfile: test/gemfiles/Gemfile.rails-2.3.x
|
28
|
-
- rvm: 2.
|
30
|
+
- rvm: 2.2.5
|
29
31
|
gemfile: test/gemfiles/Gemfile.rails-2.3.x
|
30
|
-
- rvm:
|
32
|
+
- rvm: 2.3.1
|
33
|
+
gemfile: test/gemfiles/Gemfile.rails-2.3.x
|
34
|
+
- rvm: jruby-9.1.2.0
|
31
35
|
gemfile: test/gemfiles/Gemfile.rails-2.3.x
|
32
36
|
- rvm: 1.9.3-p551
|
33
37
|
gemfile: test/gemfiles/Gemfile.rails-4.0.x
|
@@ -35,3 +39,9 @@ matrix:
|
|
35
39
|
gemfile: test/gemfiles/Gemfile.rails-4.1.x
|
36
40
|
- rvm: 1.9.3-p551
|
37
41
|
gemfile: test/gemfiles/Gemfile.rails-4.2.x
|
42
|
+
- rvm: 1.9.3-p551
|
43
|
+
gemfile: test/gemfiles/Gemfile.rails-5.0.x
|
44
|
+
- rvm: 2.0.0-p648
|
45
|
+
gemfile: test/gemfiles/Gemfile.rails-5.0.x
|
46
|
+
- rvm: 2.1.10
|
47
|
+
gemfile: test/gemfiles/Gemfile.rails-5.0.x
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ via a simple [JSON-based API](http://dev.postageapp.com/api.html).
|
|
8
8
|
|
9
9
|
# Installation
|
10
10
|
|
11
|
-
|
11
|
+
## Rails 4.x and newer
|
12
12
|
|
13
13
|
Add the `postageapp` gem to your Gemfile:
|
14
14
|
|
@@ -19,30 +19,12 @@ Then from the Rails project's root run:
|
|
19
19
|
bundle install
|
20
20
|
bin/rails generate postageapp --api-key PROJECT_API_KEY
|
21
21
|
|
22
|
-
|
22
|
+
## Legacy Versions of Rails
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
gem 'postageapp'
|
27
|
-
|
28
|
-
Then from the Rails project's root run:
|
29
|
-
|
30
|
-
bundle install
|
31
|
-
script/rails generate postageapp --api-key PROJECT_API_KEY
|
32
|
-
|
33
|
-
### Rails 2.x
|
24
|
+
* [Rails 3.x](doc/RAILS3.md)
|
25
|
+
* [Rails 2.3.x](doc/RAILS2.md)
|
34
26
|
|
35
|
-
|
36
|
-
|
37
|
-
config.gem 'postageapp'
|
38
|
-
|
39
|
-
Then from the Rails project's root run:
|
40
|
-
|
41
|
-
rake gems:install
|
42
|
-
rake gems:unpack GEM=postageapp
|
43
|
-
script/generate postageapp --api-key PROJECT_API_KEY
|
44
|
-
|
45
|
-
### Sinatra / Rack / Others
|
27
|
+
## Sinatra / Rack / Others
|
46
28
|
|
47
29
|
You'll need to install the gem first:
|
48
30
|
|
@@ -63,7 +45,8 @@ with the appropriate API key will also work.
|
|
63
45
|
|
64
46
|
# Usage
|
65
47
|
|
66
|
-
Here's an example of sending a message
|
48
|
+
Here's an example of sending a message using the
|
49
|
+
[`send_message`](http://help.postageapp.com/faqs/api/send_message) API call:
|
67
50
|
|
68
51
|
```ruby
|
69
52
|
request = PostageApp::Request.new(
|
@@ -107,7 +90,7 @@ Response usually comes back with data:
|
|
107
90
|
>> response.data
|
108
91
|
=> { 'message' => { 'id' => '12345' }}
|
109
92
|
|
110
|
-
|
93
|
+
# Recipient Override
|
111
94
|
|
112
95
|
Sometimes you don't want to send emails to real people in your application. For
|
113
96
|
that there's an ability to override to what address all emails will be
|
@@ -147,9 +130,9 @@ This way you can immediately check the status of the delivery. For example:
|
|
147
130
|
response.ok?
|
148
131
|
# => true
|
149
132
|
|
150
|
-
|
133
|
+
## Mailer Base Class
|
151
134
|
|
152
|
-
Here's an example of a mailer
|
135
|
+
Here's an example of a mailer using the `PostageApp::Mailer` base class:
|
153
136
|
|
154
137
|
```ruby
|
155
138
|
require 'postageapp/mailer'
|
@@ -194,7 +177,8 @@ class Notifier < PostageApp::Mailer
|
|
194
177
|
def signup_notification
|
195
178
|
from 'sender@example.com'
|
196
179
|
subject 'Test Email'
|
197
|
-
|
180
|
+
|
181
|
+
mail(to: 'recipient@example.com')
|
198
182
|
end
|
199
183
|
end
|
200
184
|
```
|
@@ -217,44 +201,6 @@ class DevelopmentPostageappInterceptor
|
|
217
201
|
end
|
218
202
|
```
|
219
203
|
|
220
|
-
### Rails 2
|
221
|
-
|
222
|
-
Here's an example of a mailer you'd set in in a Rails 2 environment:
|
223
|
-
|
224
|
-
```ruby
|
225
|
-
require 'postageapp/mailer'
|
226
|
-
|
227
|
-
class Notifier < PostageApp::Mailer
|
228
|
-
def signup_notification
|
229
|
-
from 'system@example.com'
|
230
|
-
subject 'New Account Information'
|
231
|
-
|
232
|
-
# Recipients can be in any format API allows.
|
233
|
-
# Here's an example of a hash format
|
234
|
-
recipients(
|
235
|
-
'recipient_1@example.com' => {
|
236
|
-
'variable_name_1' => 'value',
|
237
|
-
'variable_name_2' => 'value'
|
238
|
-
},
|
239
|
-
'recipient_2@example.com' => {
|
240
|
-
'variable_name_1' => 'value',
|
241
|
-
'variable_name_2' => 'value'
|
242
|
-
},
|
243
|
-
)
|
244
|
-
|
245
|
-
attachment(
|
246
|
-
:content_type => 'application/zip',
|
247
|
-
:filename => 'example.zip',
|
248
|
-
:body => File.read('/path/to/example.zip'
|
249
|
-
)
|
250
|
-
|
251
|
-
# PostageApp specific elements:
|
252
|
-
postageapp_template 'example_template'
|
253
|
-
postageapp_variables 'global_variable' => 'value'
|
254
|
-
end
|
255
|
-
end
|
256
|
-
```
|
257
|
-
|
258
204
|
# Automatic resending in case of failure
|
259
205
|
|
260
206
|
For those rare occasions when the API is not reachable or unresponsive,
|
data/doc/RAILS2.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# Rails 2.x
|
2
|
+
|
3
|
+
These notes describe behavior specific to the Rails 2.x environment. Unless
|
4
|
+
otherwise specified the approach in the main documentation applies.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
In `config/environment.rb` add the following:
|
9
|
+
|
10
|
+
config.gem 'postageapp'
|
11
|
+
|
12
|
+
Then from the Rails project's root run:
|
13
|
+
|
14
|
+
rake gems:install
|
15
|
+
rake gems:unpack GEM=postageapp
|
16
|
+
script/generate postageapp --api-key PROJECT_API_KEY
|
17
|
+
|
18
|
+
## Mailer Creation
|
19
|
+
|
20
|
+
Here's an example of a mailer you'd set in in a Rails 2 environment:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'postageapp/mailer'
|
24
|
+
|
25
|
+
class Notifier < PostageApp::Mailer
|
26
|
+
def signup_notification
|
27
|
+
from 'system@example.com'
|
28
|
+
subject 'New Account Information'
|
29
|
+
|
30
|
+
# Recipients can be in any format API allows.
|
31
|
+
# Here's an example of a hash format
|
32
|
+
recipients(
|
33
|
+
'recipient_1@example.com' => {
|
34
|
+
'variable_name_1' => 'value',
|
35
|
+
'variable_name_2' => 'value'
|
36
|
+
},
|
37
|
+
'recipient_2@example.com' => {
|
38
|
+
'variable_name_1' => 'value',
|
39
|
+
'variable_name_2' => 'value'
|
40
|
+
},
|
41
|
+
)
|
42
|
+
|
43
|
+
attachment(
|
44
|
+
:content_type => 'application/zip',
|
45
|
+
:filename => 'example.zip',
|
46
|
+
:body => File.read('/path/to/example.zip'
|
47
|
+
)
|
48
|
+
|
49
|
+
# PostageApp specific elements:
|
50
|
+
postageapp_template 'example_template'
|
51
|
+
postageapp_variables 'global_variable' => 'value'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
```
|
data/doc/RAILS3.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Rails 3.x
|
2
|
+
|
3
|
+
These notes describe behavior specific to the Rails 2.x environment. Unless
|
4
|
+
otherwise specified the approach in the main documentation applies.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add the `postageapp` gem to your Gemfile:
|
9
|
+
|
10
|
+
gem 'postageapp'
|
11
|
+
|
12
|
+
Then from the Rails project's root run:
|
13
|
+
|
14
|
+
bundle install
|
15
|
+
script/rails generate postageapp --api-key PROJECT_API_KEY
|
data/lib/postageapp/mailer.rb
CHANGED
@@ -168,11 +168,9 @@ class PostageApp::Mailer < ActionMailer::Base
|
|
168
168
|
|
169
169
|
protected
|
170
170
|
def each_template(paths, name, &block) #:nodoc:
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
templates.uniq { |t| t.formats }.each(&block)
|
175
|
-
end
|
171
|
+
(lookup_context.find_all(name, paths) || [ ]).uniq do |t|
|
172
|
+
t.formats
|
173
|
+
end.each(&block)
|
176
174
|
end
|
177
175
|
|
178
176
|
def create_parts_from_responses(m, responses) #:nodoc:
|
data/lib/postageapp/version.rb
CHANGED
data/postageapp.gemspec
CHANGED
@@ -1,25 +1,26 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
|
4
|
+
|
4
5
|
require 'postageapp/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
+
s.name = 'postageapp'
|
8
9
|
s.version = PostageApp::VERSION
|
9
10
|
s.authors = [
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
'Oleg Khabarov',
|
12
|
+
'Scott Tadman',
|
13
|
+
'The Working Group Inc.'
|
13
14
|
]
|
14
15
|
s.email = [
|
15
|
-
|
16
|
-
|
16
|
+
'oleg@khabarov.ca',
|
17
|
+
'tadman@postageapp.com'
|
17
18
|
]
|
18
19
|
|
19
|
-
s.homepage =
|
20
|
+
s.homepage = 'http://github.com/postageapp/postageapp-ruby'
|
20
21
|
|
21
|
-
s.summary =
|
22
|
-
s.description =
|
22
|
+
s.summary = 'Client for PostageApp Email API'
|
23
|
+
s.description = 'Official client for the PostageApp email service'
|
23
24
|
s.license = 'MIT'
|
24
25
|
|
25
26
|
s.files = `git ls-files`.split("\n")
|
data/script/with
CHANGED
data/test/gemfiles/Gemfile.ruby
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postageapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Oleg Khabarov
|
@@ -11,42 +10,37 @@ authors:
|
|
11
10
|
autorequire:
|
12
11
|
bindir: bin
|
13
12
|
cert_chain: []
|
14
|
-
date: 2016-
|
13
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: json
|
18
17
|
requirement: !ruby/object:Gem::Requirement
|
19
|
-
none: false
|
20
18
|
requirements:
|
21
|
-
- -
|
19
|
+
- - '>='
|
22
20
|
- !ruby/object:Gem::Version
|
23
21
|
version: '0'
|
24
22
|
type: :runtime
|
25
23
|
prerelease: false
|
26
24
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
-
none: false
|
28
25
|
requirements:
|
29
|
-
- -
|
26
|
+
- - '>='
|
30
27
|
- !ruby/object:Gem::Version
|
31
28
|
version: '0'
|
32
29
|
- !ruby/object:Gem::Dependency
|
33
30
|
name: mail
|
34
31
|
requirement: !ruby/object:Gem::Requirement
|
35
|
-
none: false
|
36
32
|
requirements:
|
37
|
-
- -
|
33
|
+
- - '>='
|
38
34
|
- !ruby/object:Gem::Version
|
39
35
|
version: '0'
|
40
36
|
type: :runtime
|
41
37
|
prerelease: false
|
42
38
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
39
|
requirements:
|
45
|
-
- -
|
40
|
+
- - '>='
|
46
41
|
- !ruby/object:Gem::Version
|
47
42
|
version: '0'
|
48
|
-
description:
|
49
|
-
applications
|
43
|
+
description: Official client for the PostageApp email service
|
50
44
|
email:
|
51
45
|
- oleg@khabarov.ca
|
52
46
|
- tadman@postageapp.com
|
@@ -60,6 +54,8 @@ files:
|
|
60
54
|
- LICENSE
|
61
55
|
- README.md
|
62
56
|
- Rakefile
|
57
|
+
- doc/RAILS2.md
|
58
|
+
- doc/RAILS3.md
|
63
59
|
- generators/postageapp/postageapp_generator.rb
|
64
60
|
- generators/postageapp/templates/initializer.rb
|
65
61
|
- generators/postageapp/templates/postageapp_tasks.rake
|
@@ -94,6 +90,7 @@ files:
|
|
94
90
|
- test/gemfiles/Gemfile.rails-4.0.x
|
95
91
|
- test/gemfiles/Gemfile.rails-4.1.x
|
96
92
|
- test/gemfiles/Gemfile.rails-4.2.x
|
93
|
+
- test/gemfiles/Gemfile.rails-5.0.x
|
97
94
|
- test/gemfiles/Gemfile.ruby
|
98
95
|
- test/helper.rb
|
99
96
|
- test/live_test.rb
|
@@ -129,26 +126,25 @@ files:
|
|
129
126
|
homepage: http://github.com/postageapp/postageapp-ruby
|
130
127
|
licenses:
|
131
128
|
- MIT
|
129
|
+
metadata: {}
|
132
130
|
post_install_message:
|
133
131
|
rdoc_options: []
|
134
132
|
require_paths:
|
135
133
|
- lib
|
136
134
|
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
135
|
requirements:
|
139
|
-
- -
|
136
|
+
- - '>='
|
140
137
|
- !ruby/object:Gem::Version
|
141
138
|
version: 1.9.3
|
142
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
-
none: false
|
144
140
|
requirements:
|
145
|
-
- -
|
141
|
+
- - '>='
|
146
142
|
- !ruby/object:Gem::Version
|
147
143
|
version: '0'
|
148
144
|
requirements: []
|
149
145
|
rubyforge_project:
|
150
|
-
rubygems_version:
|
146
|
+
rubygems_version: 2.0.14.1
|
151
147
|
signing_key:
|
152
|
-
specification_version:
|
153
|
-
summary:
|
148
|
+
specification_version: 4
|
149
|
+
summary: Client for PostageApp Email API
|
154
150
|
test_files: []
|