DynamoMTL / spree_chimpy

Spree/MailChimp Integration
BSD 3-Clause "New" or "Revised" License
35 stars 123 forks source link

When subscribe/unsubscribe it doesn't update in mailchimp #30

Closed bounthr closed 9 years ago

bounthr commented 10 years ago

rails 1.9.3p194 spree 2-0

In spree_chimpy/lib/spree/chimpysubscription.erb

def resubscribe(&block)
  block.call if block
  return unless configured?

  if unsubscribing?
    unsubscribe
  elsif subscribing? || merge_vars_changed?
    subscribe
  end
end

When we want to "subscribe" or "unsubscribe" with the checkbox on http://0.0.0.0:3000/fr//account/edit

def allowed?
  configured? && @model.subscribed
end

def subscribing?
  merge_vars_changed? && @model.subscribed
end

"merge_vars_changed?" always return false and if i want to unsubscribe "@model.subscribed" will be false and will conflict with the "def allowed?" so it will not be possible to unsubscribe.

I had to put it like that if i wanted it to change the subscribe or unsubscribe in mailchimp.com

def allowed?
  configured?
end

def subscribing?
  @model.subscribed
end

Maybe i'm wrong and broke everything, can you explain if i'm wrong.

braidn commented 9 years ago

@bounthr is this still occurring? I am going to close but feel free to open a new issue if there is still an issue.