freshmail_api 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b966404064d4d4c0171650ff3dc29ea880053742
4
- data.tar.gz: b04fb438224015806d5f0567bef1bae5ed5f54ee
3
+ metadata.gz: 80b8413d996326483acce67780fb2379c598455d
4
+ data.tar.gz: 2e935ed9974303f795b6a23d00588045678c3203
5
5
  SHA512:
6
- metadata.gz: 91f14047d3c3176664eb943d030cf7f9483f65b8d0a0a07bf06dbcaa7d4cad9e82020a24caf9b3d6aa703e19693aba21b77b0d792b956889269f127a322eed6c
7
- data.tar.gz: de5df6a31945a3e301ca467f6f94b06fb1aaac47f07d9319027b48a9e51f07a031dd2b958dd17de2e7897257471d2d601884a0adc2a6465d0ec5c29d605096ba
6
+ metadata.gz: b8a647e1f4927dff45f1957661ccc3d4b0aef51400c13e77bbdcf98a8e5939c721ea00ad45ec5748e889d26f976685fec1c6cfbe20d7108fd0a578d9b95c9d5a
7
+ data.tar.gz: 064db7c7b0fe6749a37563db32461c7ff0b1917cff8bd3be9031325ea34eece41a7d228d3174888d9f0cbb7e3109e6d74592edbe963597968c45cf14c3f14032
data/README.md CHANGED
@@ -3,7 +3,7 @@ Rails gem for fast Freshmail integration
3
3
 
4
4
  Documentation of Freshmail API http://freshmail.pl/wp-content/uploads/2013/04/REST_API_v1.0.19.pdf
5
5
 
6
- ## Do you like it? Give me star ;) Thank you!
6
+ ##### Do you like it ? Give me star ;) Thank you!
7
7
 
8
8
 
9
9
  ## Installation
@@ -35,28 +35,29 @@ end
35
35
 
36
36
  Next, you should use available methods:
37
37
 
38
- 1. Test your connection
38
+ ##### 1) Test your connection
39
+
39
40
  GET:
40
41
  ```ruby
41
42
  FreshmailApi.get_ping
42
43
  ```
44
+
43
45
  POST:
44
46
  ```ruby
45
47
  FreshmailApi.post_ping({data: 'some data'})
46
48
  ```
47
49
 
48
-
49
- 2. Send mail:
50
+ ##### 2) Send mail:
50
51
  ```ruby
51
52
  FreshmailApi.send_mail(subscriber: "subscriber@mail.com", subject: "test", text: "pure text message")
52
53
  or
53
54
  FreshmailApi.send_mail(subscriber: "subscriber@mail.com", subject: "test", html: "message with html tags")
54
55
  ```
55
- -require options:
56
+ >- require options:
56
57
  :subscriber,
57
58
  :subject,
58
59
  :html or :text
59
- -optional options:
60
+ >- optional options:
60
61
  :from,
61
62
  :from_name,
62
63
  :reply_to,
@@ -66,53 +67,53 @@ FreshmailApi.send_mail(subscriber: "subscriber@mail.com", subject: "test", html:
66
67
  :domain,
67
68
  :tag
68
69
 
69
- 3. Send sms message (SMS agreement required to send sms):
70
+ ##### 3) Send sms message (SMS agreement required to send sms):
70
71
  ```ruby
71
72
  FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
72
73
  ```
73
- -require options:
74
+ >- require options:
74
75
  :gsm,
75
76
  :text
76
- -optional options:
77
+ >- optional options:
77
78
  :from,
78
79
  :single
79
80
 
80
81
 
81
- 4. Reports:
82
+ ##### 4) Reports:
82
83
  4.1 Campaigns list
83
84
  ```ruby
84
85
  FreshmailApi.campaigns_list
85
86
  or
86
87
  FreshmailApi.campaigns_list(69)
87
88
  ```
88
- -optional options:
89
+ >- optional options:
89
90
  :page
90
91
 
91
92
  4.2 Campaign report
92
93
  ```ruby
93
94
  FreshmailApi.campaign_report(id_hash)
94
95
  ```
95
- -required options:
96
+ >- required options:
96
97
  :id_hash
97
98
 
98
99
  4.3 Campaign time details
99
100
  ```ruby
100
101
  FreshmailApi.campaign_time_details(id_hash)
101
102
  ```
102
- -required options:
103
+ >- required options:
103
104
  :id_hash
104
105
 
105
106
 
106
- 5. Campaign:
107
+ ##### 5) Campaign:
107
108
  5.1 Create:
108
109
  ```ruby
109
110
  FreshmailApi.create_campaign({options})
110
111
  ```
111
- -require options:
112
+ >- require options:
112
113
  :name,
113
114
  :list or :group,
114
115
  :html or :text
115
- -optional options:
116
+ >- optional options:
116
117
  :url,
117
118
  :subject,
118
119
  :from_address,
@@ -122,11 +123,11 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
122
123
 
123
124
  5.1 Edit:
124
125
  ```ruby
125
- FreshmailApi.edit_campaig({options})
126
+ FreshmailApi.edit_campaign({options})
126
127
  ```
127
- require options:
128
+ >- require options:
128
129
  :id_hash
129
- optional options:
130
+ >- optional options:
130
131
  :name,
131
132
  :url,
132
133
  :html,
@@ -141,40 +142,40 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
141
142
 
142
143
  5.1 Delete:
143
144
  ```ruby
144
- FreshmailApi.delete_campaig({options})
145
+ FreshmailApi.delete_campaign({options})
145
146
  ```
146
- require options:
147
+ >- require options:
147
148
  :hash
148
149
 
149
150
  5.1 Send test campaign:
150
151
  ```ruby
151
- FreshmailApi.send_test_campaig(hash: '4zcnmd2ski', emails: ['test1@email.com', 'test2@email.com'])
152
+ FreshmailApi.send_test_campaign(hash: '4zcnmd2ski', emails: ['test1@email.com', 'test2@email.com'])
152
153
  ```
153
- require options:
154
+ >- require options:
154
155
  :hash,
155
156
  :emails
156
- optional options:
157
+ >- optional options:
157
158
  :custom_fields
158
159
 
159
160
  5.1 Send campaign:
160
161
  ```ruby
161
- FreshmailApi.send_campaig({options})
162
+ FreshmailApi.send_campaign({options})
162
163
  ```
163
- require options:
164
+ >- require options:
164
165
  :hash
165
- optional options:
166
+ >- optional options:
166
167
  :time (format: YYYY-MM-DD H:i:s)
167
168
 
168
169
 
169
- 6. Subscriber:
170
+ ##### 6) Subscriber:
170
171
  6.1 Add:
171
172
  ```ruby
172
173
  FreshmailApi.add_subscriber({options})
173
174
  ```
174
- -require options:
175
+ >- require options:
175
176
  :email,
176
177
  :list
177
- -optional options:
178
+ >- optional options:
178
179
  :state,
179
180
  :confirm,
180
181
  :custom_fields
@@ -183,18 +184,18 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
183
184
  ```ruby
184
185
  FreshmailApi.edit_subscriber({options})
185
186
  ```
186
- -require options:
187
+ >- require options:
187
188
  :email,
188
189
  :list
189
- -optional options:
190
+ >- optional options:
190
191
  :state,
191
192
  :custom_fields
192
193
 
193
- 6.3 Add:
194
+ 6.3 Get:
194
195
  ```ruby
195
196
  FreshmailApi.get_subscriber(email: 'test@email.com', list: '4zcnmd2ski')
196
197
  ```
197
- -require options:
198
+ >- require options:
198
199
  :email,
199
200
  :list
200
201
 
@@ -202,7 +203,7 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
202
203
  ```ruby
203
204
  FreshmailApi.delete_subscriber({options})
204
205
  ```
205
- -require options:
206
+ >- require options:
206
207
  :email,
207
208
  :list
208
209
 
@@ -210,20 +211,20 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
210
211
  ```ruby
211
212
  FreshmailApi.get_subscriber_history(email: 'test@email.com', list: '4zcnmd2ski', limit: 30)
212
213
  ```
213
- -require options:
214
+ >- require options:
214
215
  :email,
215
216
  :list
216
- -optional options:
217
+ >- optional options:
217
218
  :limit (default: 10)
218
219
 
219
220
  6.6 Add subscribers:
220
221
  ```ruby
221
222
  FreshmailApi.add_subscribers(subscribers: [{email: 'test@email.com'}, {email: 'test@email.com'}], list: '4zcnmd2ski')
222
223
  ```
223
- -require options:
224
+ >- require options:
224
225
  :subscribers,
225
226
  :list
226
- -optional options:
227
+ >- optional options:
227
228
  :state,
228
229
  :confirm
229
230
 
@@ -231,10 +232,10 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
231
232
  ```ruby
232
233
  FreshmailApi.edit_subscribers(subscribers: [{email: 'test@email.com'}, {email: 'test@email.com'}], list: '4zcnmd2ski')
233
234
  ```
234
- -require options:
235
+ >- require options:
235
236
  :subscribers,
236
237
  :list
237
- -optional options:
238
+ >- optional options:
238
239
  :state,
239
240
  :confirm
240
241
 
@@ -242,7 +243,7 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
242
243
  ```ruby
243
244
  FreshmailApi.update_subscriber_field({options})
244
245
  ```
245
- -require options:
246
+ >- require options:
246
247
  :listHash,
247
248
  :tag,
248
249
  :value,
@@ -252,7 +253,7 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
252
253
  ```ruby
253
254
  FreshmailApi.get_subscribers({options})
254
255
  ```
255
- -require options:
256
+ >- require options:
256
257
  :subscribers,
257
258
  :list
258
259
 
@@ -260,7 +261,7 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
260
261
  ```ruby
261
262
  FreshmailApi.delete_subscribers({options})
262
263
  ```
263
- -require options:
264
+ >- require options:
264
265
  :subscribers,
265
266
  :list
266
267
 
@@ -268,42 +269,42 @@ FreshmailApi.send_sms(gsm: "123456789", text: "hello bro! :)")
268
269
  ```ruby
269
270
  FreshmailApi.block_subscribers({options})
270
271
  ```
271
- -require options:
272
+ >- require options:
272
273
  :emails
273
274
 
274
275
  6.12 Unblock subscribers:
275
276
  ```ruby
276
277
  FreshmailApi.unblock_subscribers({options})
277
278
  ```
278
- -require options:
279
+ >- require options:
279
280
  :emails
280
281
 
281
282
 
282
- 7. Create account:
283
+ ##### 7) Create account:
283
284
  ```ruby
284
285
  FreshmailApi.create_account({options})
285
286
  ```
286
- -require options:
287
+ >- require options:
287
288
  :login,
288
289
  :password,
289
290
  :firstname,
290
291
  :lastname,
291
292
  :phone
292
- -optional options:
293
+ >- optional options:
293
294
  :company,
294
295
  :activation_email,
295
296
  :activation,
296
297
  :child_account
297
298
 
298
299
 
299
- 8. Subscribers list:
300
+ ##### 8) Subscribers list:
300
301
  8.1 Create:
301
302
  ```ruby
302
303
  FreshmailApi.create_subscribers_list({options})
303
304
  ```
304
- -require options:
305
+ >- require options:
305
306
  :name
306
- -optional options:
307
+ >- optional options:
307
308
  :description,
308
309
  :custom_field
309
310
 
@@ -311,17 +312,17 @@ FreshmailApi.create_account({options})
311
312
  ```ruby
312
313
  FreshmailApi.update_subscribers_list({options})
313
314
  ```
314
- -require options:
315
+ >- require options:
315
316
  :hash,
316
317
  :name
317
- -optional options:
318
+ >- optional options:
318
319
  :description
319
320
 
320
321
  8.3 Delete:
321
322
  ```ruby
322
323
  FreshmailApi.delete_subscribers_list({options})
323
324
  ```
324
- -require options:
325
+ >- require options:
325
326
  :hash
326
327
 
327
328
  8.4 Get lists:
@@ -333,10 +334,10 @@ FreshmailApi.create_account({options})
333
334
  ```ruby
334
335
  FreshmailApi.add_field_to_subscribers_list({options})
335
336
  ```
336
- -require options:
337
+ >- require options:
337
338
  :hash,
338
339
  :name
339
- -optional options:
340
+ >- optional options:
340
341
  :tag,
341
342
  :type
342
343
 
@@ -344,16 +345,16 @@ FreshmailApi.create_account({options})
344
345
  ```ruby
345
346
  FreshmailApi.get_subscribers_list_fields({options})
346
347
  ```
347
- -require options:
348
+ >- require options:
348
349
  :hash
349
350
 
350
- 9. Spam test:
351
+ ##### 9) Spam test:
351
352
  ```ruby
352
353
  FreshmailApi.check_spam_test({options})
353
354
  ```
354
- -require options:
355
+ >- require options:
355
356
  :subject
356
- -optional options:
357
+ >- optional options:
357
358
  :from,
358
359
  :from_name,
359
360
  :html or :text
@@ -5,19 +5,19 @@ module FreshmailApi
5
5
  perform(:post, 'campaigns/create', data)
6
6
  end
7
7
 
8
- def edit_campaig(data)
8
+ def edit_campaign(data)
9
9
  perform(:post, 'campaigns/edit', data)
10
10
  end
11
11
 
12
- def delete_campaig(data)
12
+ def delete_campaign(data)
13
13
  perform(:post, 'campaigns/delete', data)
14
14
  end
15
15
 
16
- def send_test_campaig(data)
16
+ def send_test_campaign(data)
17
17
  perform(:post, 'campaigns/sendTest', data)
18
18
  end
19
19
 
20
- def send_campaig(data)
20
+ def send_campaign(data)
21
21
  perform(:post, 'campaigns/send', data)
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module FreshmailApi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -109,35 +109,35 @@ describe FreshmailApi do
109
109
  end
110
110
  end
111
111
 
112
- describe '.edit_campaig' do
112
+ describe '.edit_campaign' do
113
113
  let(:path) { 'campaigns/edit' }
114
114
  it do
115
- stubs.post(url) { |env| [ 200, {}, '{"status": "edit_campaig OK"}']}
116
- expect(described_class.edit_campaig({data: 'data'})).to eq({ 'status' => 'edit_campaig OK' })
115
+ stubs.post(url) { |env| [ 200, {}, '{"status": "edit_campaign OK"}']}
116
+ expect(described_class.edit_campaign({data: 'data'})).to eq({ 'status' => 'edit_campaign OK' })
117
117
  end
118
118
  end
119
119
 
120
- describe '.delete_campaig' do
120
+ describe '.delete_campaign' do
121
121
  let(:path) { 'campaigns/delete' }
122
122
  it do
123
- stubs.post(url) { |env| [ 200, {}, '{"status": "delete_campaig OK"}']}
124
- expect(described_class.delete_campaig({data: 'data'})).to eq({ 'status' => 'delete_campaig OK' })
123
+ stubs.post(url) { |env| [ 200, {}, '{"status": "delete_campaign OK"}']}
124
+ expect(described_class.delete_campaign({data: 'data'})).to eq({ 'status' => 'delete_campaign OK' })
125
125
  end
126
126
  end
127
127
 
128
- describe '.send_test_campaig' do
128
+ describe '.send_test_campaign' do
129
129
  let(:path) { 'campaigns/sendTest' }
130
130
  it do
131
- stubs.post(url) { |env| [ 200, {}, '{"status": "send_test_campaig OK"}']}
132
- expect(described_class.send_test_campaig({data: 'data'})).to eq({ 'status' => 'send_test_campaig OK' })
131
+ stubs.post(url) { |env| [ 200, {}, '{"status": "send_test_campaign OK"}']}
132
+ expect(described_class.send_test_campaign({data: 'data'})).to eq({ 'status' => 'send_test_campaign OK' })
133
133
  end
134
134
  end
135
135
 
136
- describe '.send_campaig' do
136
+ describe '.send_campaign' do
137
137
  let(:path) { 'campaigns/send' }
138
138
  it do
139
- stubs.post(url) { |env| [ 200, {}, '{"status": "send_campaig OK"}']}
140
- expect(described_class.send_campaig({data: 'data'})).to eq({ 'status' => 'send_campaig OK' })
139
+ stubs.post(url) { |env| [ 200, {}, '{"status": "send_campaign OK"}']}
140
+ expect(described_class.send_campaign({data: 'data'})).to eq({ 'status' => 'send_campaign OK' })
141
141
  end
142
142
  end
143
143
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freshmail_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Śliwecki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-06 00:00:00.000000000 Z
11
+ date: 2015-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.7'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '10.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Rails gem for fast Freshmail integration
@@ -87,9 +87,9 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
91
- - .rspec
92
- - .travis.yml
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
93
  - Gemfile
94
94
  - LICENSE.txt
95
95
  - README.md
@@ -122,17 +122,17 @@ require_paths:
122
122
  - lib
123
123
  required_ruby_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - '>='
125
+ - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - '>='
130
+ - - ">="
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
134
  rubyforge_project:
135
- rubygems_version: 2.4.5
135
+ rubygems_version: 2.4.8
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Freshmail REST API v3.0