maropost 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -2
- data/README.md +21 -21
- data/lib/maropost/api.rb +7 -7
- data/lib/maropost/contact.rb +5 -4
- data/lib/maropost/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c39222bf12c1d855cef900060f8cb24771387073
|
4
|
+
data.tar.gz: 24b183da1021fb2cd7323c9f701116c4d2d78857
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaba52fbd153a4429e5a03a45c06f8dd797d750f5d2fea4ea9dbfcf61b4ccee01f9c6ddac4484cdd08f541e1816cd4bee36c51fc8d099ba5639ded269e2986bc
|
7
|
+
data.tar.gz: 07ebe611835d1cf5da7b90b3ab16ef98c65fa48b9ec0d766ab6ab51cb131242bc4a61a1eb1e4050e49d358c33a75cf4aace439cc5c068a55e3114d4a414ca14d
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Maropost
|
1
|
+
# Maropost [![Build Status](https://travis-ci.org/amaabca/maropost.svg)](https://travis-ci.org/amaabca/maropost)
|
2
2
|
|
3
3
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/maropost`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
@@ -29,26 +29,26 @@ Maropost::Api.find('email@example.com')
|
|
29
29
|
|
30
30
|
To create or update a contact in Maropost:
|
31
31
|
```ruby
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
)
|
32
|
+
Maropost::Api.update_subscriptions(
|
33
|
+
Maropost::Contact.new(
|
34
|
+
email: email,
|
35
|
+
ama_rewards: ama_rewards,
|
36
|
+
ama_membership: ama_membership,
|
37
|
+
ama_insurance: ama_insurance,
|
38
|
+
ama_travel: ama_travel,
|
39
|
+
ama_new_member_series: ama_new_member_series,
|
40
|
+
ama_fleet_safety: ama_fleet_safety,
|
41
|
+
ovrr_personal: personal_vehicle_reminder,
|
42
|
+
ovrr_business: business_vehicle_reminder,
|
43
|
+
ovrr_associate: associate_vehicle_reminder,
|
44
|
+
ama_vr_reminder: ama_vr_reminder,
|
45
|
+
ama_vr_reminder_email: ama_vr_reminder_email,
|
46
|
+
ama_vr_reminder_sms: ama_vr_reminder_sms,
|
47
|
+
ama_vr_reminder_autocall: ama_vr_reminder_autocall,
|
48
|
+
cell_phone_number: cell_phone_number.present? ? "1#{cell_phone_number}" : '',
|
49
|
+
phone: phone_number
|
51
50
|
)
|
51
|
+
)
|
52
52
|
```
|
53
53
|
|
54
54
|
## Development
|
@@ -59,7 +59,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
59
59
|
|
60
60
|
## Contributing
|
61
61
|
|
62
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
62
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/amaabca/maropost.
|
63
63
|
|
64
64
|
|
65
65
|
## License
|
data/lib/maropost/api.rb
CHANGED
@@ -45,7 +45,7 @@ module Maropost
|
|
45
45
|
timeout: 10,
|
46
46
|
open_timeout: 10,
|
47
47
|
url: url,
|
48
|
-
payload: {auth_token: Maropost.configuration.auth_token}.merge(payload).to_json,
|
48
|
+
payload: { auth_token: Maropost.configuration.auth_token }.merge(payload).to_json,
|
49
49
|
headers: { content_type: 'application/json', accept: 'application/json' },
|
50
50
|
verify_ssl: OpenSSL::SSL::VERIFY_PEER
|
51
51
|
)
|
@@ -53,6 +53,7 @@ module Maropost
|
|
53
53
|
|
54
54
|
def self.create_or_update_payload(contact)
|
55
55
|
{ contact: { email: contact.email,
|
56
|
+
phone: contact.phone_number,
|
56
57
|
custom_field: {
|
57
58
|
ama_rewards: contact.ama_rewards,
|
58
59
|
ama_membership: contact.ama_membership,
|
@@ -60,17 +61,16 @@ module Maropost
|
|
60
61
|
ama_travel: contact.ama_travel,
|
61
62
|
ama_new_member_series: contact.ama_new_member_series,
|
62
63
|
ama_fleet_safety: contact.ama_fleet_safety,
|
63
|
-
|
64
|
-
|
65
|
-
|
64
|
+
ovrr_personal: contact.ovrr_personal,
|
65
|
+
ovrr_business: contact.ovrr_business,
|
66
|
+
ovrr_associate: contact.ovrr_associate,
|
66
67
|
ama_vr_reminder: contact.ama_vr_reminder,
|
67
68
|
ama_vr_reminder_email: contact.ama_vr_reminder_email,
|
68
69
|
ama_vr_reminder_sms: contact.ama_vr_reminder_sms,
|
69
70
|
ama_vr_reminder_autocall: contact.ama_vr_reminder_autocall,
|
70
|
-
cell_phone_number: contact.cell_phone_number
|
71
|
-
phone: contact.phone_number
|
71
|
+
cell_phone_number: contact.cell_phone_number
|
72
72
|
}
|
73
|
-
|
73
|
+
}
|
74
74
|
}
|
75
75
|
end
|
76
76
|
end
|
data/lib/maropost/contact.rb
CHANGED
@@ -2,11 +2,12 @@ module Maropost
|
|
2
2
|
class Contact
|
3
3
|
attr_accessor :id, :email,
|
4
4
|
:ama_rewards, :ama_membership, :ama_insurance, :ama_travel, :ama_new_member_series, :ama_fleet_safety,
|
5
|
-
:
|
5
|
+
:ovrr_personal, :ovrr_business, :ovrr_associate,
|
6
6
|
:ama_vr_reminder, :ama_vr_reminder_email, :ama_vr_reminder_sms, :ama_vr_reminder_autocall,
|
7
7
|
:phone_number, :cell_phone_number, :errors
|
8
8
|
|
9
9
|
def initialize(data)
|
10
|
+
data = data.stringify_keys
|
10
11
|
self.id = data['id']
|
11
12
|
self.email = data['email']
|
12
13
|
self.ama_rewards = data['ama_rewards'] || '0'
|
@@ -15,9 +16,9 @@ module Maropost
|
|
15
16
|
self.ama_travel = data['ama_travel'] || '0'
|
16
17
|
self.ama_new_member_series = data['ama_new_member_series'] || '0'
|
17
18
|
self.ama_fleet_safety = data['ama_fleet_safety'] || '0'
|
18
|
-
self.
|
19
|
-
self.
|
20
|
-
self.
|
19
|
+
self.ovrr_personal = data['ovrr_personal'] || ''
|
20
|
+
self.ovrr_business = data['ovrr_business'] || ''
|
21
|
+
self.ovrr_associate = data['ovrr_associate'] || ''
|
21
22
|
self.ama_vr_reminder = data['ama_vr_reminder'] || '0'
|
22
23
|
self.ama_vr_reminder_email = data['ama_vr_reminder_email'] || '0'
|
23
24
|
self.ama_vr_reminder_sms = data['ama_vr_reminder_sms'] || '0'
|
data/lib/maropost/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maropost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van den Beuken
|
@@ -21,7 +21,7 @@ authors:
|
|
21
21
|
autorequire:
|
22
22
|
bindir: exe
|
23
23
|
cert_chain: []
|
24
|
-
date: 2017-
|
24
|
+
date: 2017-10-04 00:00:00.000000000 Z
|
25
25
|
dependencies:
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rest-client
|