maxemail_api 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/maxemail_api/subscriptions.rb +7 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b03b6b489afedf7072b13a1b275b3872c0779bf6
|
4
|
+
data.tar.gz: 11a8f8f64a661af1351c5ace19af839b27120d9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859b2580af904cd93c19cd815d7fb6dc5a4e743de0fa674e82bc3d2717d0fb9f8c14d9e03d6ad1cbf68c8aef5099b90a63409c4b9826291ae17c84eb461f7367
|
7
|
+
data.tar.gz: b8b97c92c93f15e45333a964dbd433b65bce774cef835da6f84b1aa4ce30b1821519e0aa6cd819a7d2be0902786501d80597ff1571fa7ab3f09339f2987755c0
|
@@ -31,21 +31,26 @@ module MaxemailApiSubscriptions
|
|
31
31
|
|
32
32
|
def unsubscribe(email_address: nil, recipient_id: nil, list_id:)
|
33
33
|
recipient_id = find_recipient_id(email_address: email_address) if recipient_id.nil?
|
34
|
+
return false if recipient_id.nil?
|
34
35
|
MaxemailApiShared.send_request(params: { method: 'updateRecipient', data: { email_address: email_address, subscribed: 0 }.to_json, listID: list_id, recipientId: recipient_id }, method: 'list')
|
35
36
|
end
|
36
37
|
|
37
38
|
def subscriptions(email_address: nil, recipient_id: nil, list_id:)
|
38
39
|
recipient_id = find_recipient_id(email_address: email_address) if recipient_id.nil?
|
40
|
+
return false if recipient_id.nil?
|
39
41
|
MaxemailApiShared.send_request(params: { method: 'fetchLists', listID: list_id, recipientId: recipient_id }, method: 'recipient')
|
40
42
|
end
|
41
43
|
|
42
|
-
def update_subscription_email(old_email_address:nil, recipient_id: nil, new_email_address:)
|
44
|
+
def update_subscription_email(old_email_address: nil, recipient_id: nil, new_email_address:)
|
43
45
|
recipient_id = find_recipient_id(email_address: old_email_address) if recipient_id.nil?
|
46
|
+
return false if recipient_id.nil?
|
44
47
|
MaxemailApiShared.send_request(params: { method: 'update', data: { email_address: new_email_address }.to_json, recipientId: recipient_id }, method: 'recipient')
|
45
48
|
end
|
46
49
|
|
47
50
|
def find_recipient_id(email_address: nil)
|
48
|
-
MaxemailApiShared.send_request(params: { method: 'findByEmailAddress', emailAddress: email_address }, method: 'recipient')
|
51
|
+
response = MaxemailApiShared.send_request(params: { method: 'findByEmailAddress', emailAddress: email_address }, method: 'recipient').to_s
|
52
|
+
return nil if response == 'null'
|
53
|
+
response
|
49
54
|
end
|
50
55
|
|
51
56
|
def available_subscriptions
|