Sha256: fc3b48e2beec2d77435508ee8af73bff0b68019320bfff14dd3029317f513ff4

Contents?: true

Size: 634 Bytes

Versions: 4

Compression:

Stored size: 634 Bytes

Contents

module Workarea
  module Listrak
    class UnsubscribeEmailSignup
      include Sidekiq::Worker
      include Sidekiq::CallbacksWorker

      sidekiq_options(
        enqueue_on: {
          Email::Signup => :destroy,
          with: -> { [email] }
        },
        queue: "low",
        retry: true
      )

      def perform(email)
        contact = Listrak::Models::ContactForm.new(
          email: email,
          subscription_state: 'Unsubscribed'
        )

        list_id = Listrak.configuration.default_list_id
        Listrak.email.contacts.upsert list_id, contact, overrideUnsubscribe: true
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
workarea-listrak-5.0.4 app/workers/workarea/listrak/unsubscribe_email_signup.rb
workarea-listrak-5.0.3 app/workers/workarea/listrak/unsubscribe_email_signup.rb
workarea-listrak-5.0.2 app/workers/workarea/listrak/unsubscribe_email_signup.rb
workarea-listrak-5.0.1 app/workers/workarea/listrak/unsubscribe_email_signup.rb