Skip to content

Commit

Permalink
Add support for Subscriber#is_subscribed?
Browse files Browse the repository at this point in the history
  • Loading branch information
Empact committed Aug 10, 2008
1 parent 2b959d1 commit c557fe0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/campaign_monitor/subscriber.rb
Expand Up @@ -30,5 +30,12 @@ def add_and_resubscribe(list_id)
def unsubscribe(list_id)
Result.new(@cm_client.Subscriber_Unsubscribe("ListID" => list_id, "Email" => @email_address))
end

def is_subscribed?(list_id)
result = @cm_client.Subscribers_GetIsSubscribed("ListID" => list_id, "Email" => @email_address)
return true if result == 'True'
return false if result == 'False'
raise "Invalid value for is_subscribed?: #{result}"
end
end
end

0 comments on commit c557fe0

Please sign in to comment.