effective_mailchimp 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: 6a5caed2328b202f012d4c813afb0c5038aa304b6b7efdcf30097bcc7ff7be2e
4
- data.tar.gz: ed2fb79473591925eaf5ac5f2556464afb01269370e173215988afa33630dd12
3
+ metadata.gz: 6828c1db2915c26b5aa9d2401496925b0898ff71edb6436d9283c895942967f7
4
+ data.tar.gz: 33db597cfe2e2ae408fc05b106ef4354b63bdfee2fa286bc10e8ccf5ed8e68df
5
5
  SHA512:
6
- metadata.gz: 272d0eda1823ee5df64c6f32612707cf5a80cabcd27b8cfd1ed346b2dc6e95142482e81fbc4f8c2bbd8afbce92be580898685b4c6833c83728bd30a408f8f9d4
7
- data.tar.gz: 33c4543526fe5b465f4a2252482fd5d9774f62a06f2b82cc825274599f0e3f53f0a5f48891e66c4cb983451669f23e4e201c7979f4207e30e0051c7f49696f69
6
+ metadata.gz: 4e2eceb6d94dd48f78b43090bd51742f092b22b10c028636f2ab522562aa295bd361d6629d238c5ef99b5fe2ef0a7abb5dca9f72b2cfabd89c5c1bf4878cf072
7
+ data.tar.gz: 2b13409e3e4ef8b84f8541fda2d386649d149e6e52de6c41d8888894be2ad25f375dc5100443e224a9f596b12bbeafad4df883f8f96fd7eada54030a3faf3a16
@@ -183,13 +183,13 @@ module EffectiveMailchimpUser
183
183
 
184
184
  assign_attributes(mailchimp_user_form_action: nil)
185
185
 
186
- mailchimp_list_members.map do |member|
186
+ mailchimp_list_members.each do |member|
187
187
  if member.mailchimp_id.blank? && member.subscribed?
188
188
  list_member = api.list_member_add(member)
189
- member.assign_mailchimp_attributes(list_member)
189
+ member.assign_mailchimp_attributes(list_member) if list_member.present?
190
190
  elsif member.mailchimp_id.present?
191
191
  list_member = api.list_member_update(member)
192
- member.assign_mailchimp_attributes(list_member)
192
+ member.assign_mailchimp_attributes(list_member) if list_member.present?
193
193
  end
194
194
  end
195
195
 
@@ -94,7 +94,13 @@ module Effective
94
94
  merge_fields: merge_fields.delete_if { |k, v| v.blank? }
95
95
  }
96
96
 
97
- client.lists.add_list_member(member.mailchimp_list.mailchimp_id, payload)
97
+ begin
98
+ client.lists.add_list_member(member.mailchimp_list.mailchimp_id, payload)
99
+ rescue MailchimpMarketing::ApiError => e
100
+ return false if e.status == 400 && e.to_s.downcase.include?("member in compliance state")
101
+ raise(e)
102
+ end
103
+
98
104
  end
99
105
 
100
106
  def list_member_update(member)
@@ -1,3 +1,3 @@
1
1
  module EffectiveMailchimp
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_mailchimp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-04 00:00:00.000000000 Z
11
+ date: 2023-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails