effective_mailchimp 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/effective_mailchimp_user.rb +3 -3
- data/app/models/effective/mailchimp_api.rb +7 -1
- data/app/models/effective/mailchimp_list.rb +0 -1
- data/config/effective_mailchimp.rb +0 -3
- data/db/migrate/{01_create_effective_mailchimp.rb.erb → 101_create_effective_mailchimp.rb} +0 -1
- data/lib/effective_mailchimp/version.rb +1 -1
- data/lib/generators/effective_mailchimp/install_generator.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 214e9412954d0415e5263797289e58956f53b56828715aaf390e7c9d7db09f61
|
4
|
+
data.tar.gz: 6a029f0bb604421755c58cfa5f988d581cc688f990de102901f2e5938a643980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e6b26604ad0d1c0e094706da41be5280f757073747a2203de09854990562f0a947022f3e05223c1e38bca818c77840d320a589d3bd1968f624a1dfd26b9e911
|
7
|
+
data.tar.gz: 18513f661502df66716ddf9b293ae05fd1b5d14c6e2ff68678172b3b3d4d90b606238dfe98979f38cf85fefa8562e92e8fa0dbc9b85e1ce2dd08ce247ca8100d
|
@@ -183,13 +183,13 @@ module EffectiveMailchimpUser
|
|
183
183
|
|
184
184
|
assign_attributes(mailchimp_user_form_action: nil)
|
185
185
|
|
186
|
-
mailchimp_list_members.
|
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
|
-
|
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,7 +1,4 @@
|
|
1
1
|
EffectiveMailchimp.setup do |config|
|
2
|
-
# config.mailchimp_lists_table_name = :mailchimp_lists
|
3
|
-
# config.mailchimp_list_members_table_name = :mailchimp_list_members
|
4
|
-
|
5
2
|
# Layout Settings
|
6
3
|
# Configure the Layout per controller, or all at once
|
7
4
|
# config.layout = { application: 'application', admin: 'admin' }
|
@@ -20,7 +20,7 @@ module EffectiveMailchimp
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def create_migration_file
|
23
|
-
migration_template ('../' * 3) + 'db/migrate/
|
23
|
+
migration_template ('../' * 3) + 'db/migrate/101_create_effective_mailchimp.rb', 'db/migrate/create_effective_mailchimp.rb'
|
24
24
|
end
|
25
25
|
|
26
26
|
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.
|
4
|
+
version: 0.4.0
|
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-
|
11
|
+
date: 2023-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -211,7 +211,7 @@ files:
|
|
211
211
|
- app/views/effective/mailchimp_user/_sync.html.haml
|
212
212
|
- config/effective_mailchimp.rb
|
213
213
|
- config/routes.rb
|
214
|
-
- db/migrate/
|
214
|
+
- db/migrate/101_create_effective_mailchimp.rb
|
215
215
|
- db/seeds.rb
|
216
216
|
- lib/effective_mailchimp.rb
|
217
217
|
- lib/effective_mailchimp/engine.rb
|