maropost 0.8.2 → 0.9.0
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 +4 -4
- data/lib/maropost/api.rb +7 -0
- data/lib/maropost/contact.rb +4 -0
- 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: e5a67e3d0d27f55420993b328223b169315dbc72
|
4
|
+
data.tar.gz: c06543d4a24f816e49f0d806a5b5a7b26dec6959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 140e76bf3ca05ad5495c3c78e0fb9ee27698c835e52134376d73a94df4defcb870ead18d01010c51969c7be6c3f0e71269cea26bf47a31d7bd4dfc87749fd67c
|
7
|
+
data.tar.gz: 5d42864babb57f4d39f88ad2f313ad55b2b674881a174f1baa8c9aacf895472f2a701a8ce1610db1e62147658d722a1a1bf1f764b93876010d55090592d0f3ff
|
data/lib/maropost/api.rb
CHANGED
@@ -84,6 +84,13 @@ module Maropost
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def create_or_update_payload(contact)
|
87
|
+
payload(contact).tap do |p|
|
88
|
+
p[:contact][:first_name] = contact.try(:first_name) if contact.try(:first_name)
|
89
|
+
p[:contact][:last_name] = contact.try(:last_name) if contact.try(:last_name)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def payload(contact)
|
87
94
|
{
|
88
95
|
contact: {
|
89
96
|
email: contact.email,
|
data/lib/maropost/contact.rb
CHANGED
@@ -7,6 +7,8 @@ module Maropost
|
|
7
7
|
id
|
8
8
|
email
|
9
9
|
phone_number
|
10
|
+
first_name
|
11
|
+
last_name
|
10
12
|
cell_phone_number
|
11
13
|
lists
|
12
14
|
errors
|
@@ -34,6 +36,8 @@ module Maropost
|
|
34
36
|
self.id = data[:id]
|
35
37
|
self.email = data[:email]
|
36
38
|
self.phone_number = data[:phone]
|
39
|
+
self.first_name = data[:first_name]
|
40
|
+
self.last_name = data[:last_name]
|
37
41
|
self.cell_phone_number = data[:cell_phone_number]
|
38
42
|
self.allow_emails = data.fetch(:allow_emails) { !DoNotMailList.exists?(self) }
|
39
43
|
self.errors = []
|
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.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van den Beuken
|
@@ -19,7 +19,7 @@ authors:
|
|
19
19
|
autorequire:
|
20
20
|
bindir: bin
|
21
21
|
cert_chain: []
|
22
|
-
date:
|
22
|
+
date: 2018-07-24 00:00:00.000000000 Z
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: rest-client
|