Class: Workarea::Listrak::UnsubscribeEmailSignup

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::CallbacksWorker, Sidekiq::Worker
Defined in:
app/workers/workarea/listrak/unsubscribe_email_signup.rb

Instance Method Summary collapse

Instance Method Details

#perform(email) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'app/workers/workarea/listrak/unsubscribe_email_signup.rb', line 16

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