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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edd501253b75b15d28dd0f84d550f02870d9644e
4
- data.tar.gz: d2611b6d2eef9ef4421bdecfccd05a969ba67124
3
+ metadata.gz: b03b6b489afedf7072b13a1b275b3872c0779bf6
4
+ data.tar.gz: 11a8f8f64a661af1351c5ace19af839b27120d9b
5
5
  SHA512:
6
- metadata.gz: 5b2d9c69c4d07e55a1a67e535d2a13ff1f93ccc2da04a0167b2b490256155cfa2cd0a1dc0cb663313be7f233cbb3f74923bd50122c7c9af45344ff638ad7c8aa
7
- data.tar.gz: 01cb9e5e9a56fb47282920a8b5dc2cfe180f439dee40f612f1319cdc53ea86c408d7024f77ccdb93d7fa303720a29f18a227b3ab1ea7b22a4482ec25d33e0098
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxemail_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Murray Catto