Skip to content

Commit

Permalink
Changed list_id to read directly from config.
Browse files Browse the repository at this point in the history
  • Loading branch information
anwajler committed Jul 19, 2011
1 parent c8d3682 commit 90c6069
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/campaign_monitor_subscriber.rb
Expand Up @@ -9,23 +9,18 @@ def subscribe_me_using(email_field)
after_create do |record|
begin
s = Campaigning::Subscriber.new(record.send(email_field))
s.add!(cm_list_id)
s.add!(CM_CONFIG['list_id'])
rescue RuntimeError
end
end

after_destroy do |record|
begin
Campaigning::Subscriber.unsubscribe!(record.send(email_field), cm_list_id)
Campaigning::Subscriber.unsubscribe!(record.send(email_field), CM_CONFIG['list_id'])
rescue RuntimeError
end
end
end

private
def cm_list_id
CM_CONFIG['list_id']
end
end

ActiveRecord::Base.extend(CampaignMonitorSubscriber)

0 comments on commit 90c6069

Please sign in to comment.