Skip to content

Commit

Permalink
don't raise if campaign monitor fails
Browse files Browse the repository at this point in the history
  • Loading branch information
fd committed Apr 29, 2010
1 parent 5fde675 commit b602943
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/subscriptions_controller.rb
Expand Up @@ -3,7 +3,7 @@ class SubscriptionsController < ApplicationController
def create
if params[:subscription] and email = params[:subscription][:email]
subscriber = Campaigning::Subscriber.new(self.email, nil)
subscriber.add_and_resubscribe!(CAMPAIGN_MONITOR_LIST_ID)
subscriber.add_and_resubscribe!(CAMPAIGN_MONITOR_LIST_ID) rescue nil
flash[:notice] = 'Thank you for subscribing to our newsletter.'
redirect_to :back
else
Expand Down
6 changes: 3 additions & 3 deletions app/models/user.rb
Expand Up @@ -65,7 +65,7 @@ def deliver_password_reset_instructions!
reset_perishable_token!
Notifier.deliver_password_reset_instructions(self)
end

private

def manage_newsletter_subscription
Expand All @@ -80,13 +80,13 @@ def manage_newsletter_subscription

def subscribe_to_newsletter
subscriber = Campaigning::Subscriber.new(self.email, self.name)
subscriber.add_and_resubscribe!(CAMPAIGN_MONITOR_LIST_ID)
subscriber.add_and_resubscribe!(CAMPAIGN_MONITOR_LIST_ID) rescue nil
true
end

def unsubscribe_from_newsletter
subscriber = Campaigning::Subscriber.new(self.email)
subscriber.unsubscribe!(CAMPAIGN_MONITOR_LIST_ID)
subscriber.unsubscribe!(CAMPAIGN_MONITOR_LIST_ID) rescue nil
true
end

Expand Down

0 comments on commit b602943

Please sign in to comment.