Add EmailListCreateJob

This commit is contained in:
Eric Schultz 2019-11-07 15:46:11 -06:00
parent 5236eda39d
commit ca63818181
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
class EmailListCreateJob < ApplicationJob
queue_as :default
def perform(npo_id)
UpdateEmailLists.populate_lists_on_mailchimp(npo_id)
end
end

View file

@ -36,7 +36,7 @@ module InsertEmailLists
.returning('*') .returning('*')
.execute .execute
UpdateEmailLists.delay.populate_lists_on_mailchimp(npo_id) EmailListCreateJob.perform_later(npo_id)
{ deleted: deleted, deleted_result: result, inserted_lists: inserted_lists, inserted_result: lists } { deleted: deleted, deleted_result: result, inserted_lists: inserted_lists, inserted_result: lists }
end end