Add MailchimpSupporterSyncJob
This commit is contained in:
parent
626e01b035
commit
84b1960a9d
2 changed files with 8 additions and 1 deletions
7
app/jobs/mailchimp_supporter_sync_job.rb
Normal file
7
app/jobs/mailchimp_supporter_sync_job.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class MailchimpSupporterSyncJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(np_id, supporter_ids, tag_data)
|
||||
Mailchimp.sync_supporters_to_list_from_tag_joins(np_id, supporter_ids, tag_data)
|
||||
end
|
||||
end
|
|
@ -81,7 +81,7 @@ module InsertTagJoins
|
|||
# activities = Psql.execute( Qexpr.new.insert(:activities, activity_data) )
|
||||
|
||||
# Sync mailchimp lists, if present
|
||||
Mailchimp.delay.sync_supporters_to_list_from_tag_joins(np_id, supporter_ids, tag_data)
|
||||
MailchimpSupporterSyncJob.perform_later(np_id, supporter_ids, tag_data)
|
||||
|
||||
{ json: { inserted_count: tags.count, removed_count: deleted.count }, status: :ok }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue