Skip to content

Find if the user is subscribed

edited November 2012 in Suggestions
I am using sendy as a mailing backend for my rails application.
On my site I have my own form, where user can switch on the checkboxes of the mailing lists he wants to be subscribed to.
After the checkbox is switched on/off I can subscribe/unsubscribe the user from the given mailing list with sendy API.
That's great.
But! Is there a way to find out if user is already subscriber to a given list or not — to set the default state of my checkboxes? There is no such call in the api. Maybe I can make direct mysql call, but then there is a problem, that I have my rails and php stuff on different machines, so I am not sure if I can open up a socket to alien mysql server? API call would be great.


  • I'll certainly add this API. Thanks for the suggestion!
  • edited November 2012
    Currently I decided to use "Already subscribed." response.
    It works.
    I subscribe a user to the list. If user is subscribed, then I get "Already subscribed." and happily set $my_subscribed to true.
    If in the subscribe response I don't get "Already subscribed.", then I know that user was not subscribed and set $my_subscribed to false. Then I need to unsubscribe a user from the list to restore initial state.
    But here I get a surprise. When I unsubscribe a user from a list, then user gets unsubscribed from all lists. I checked the post parameters. 'list' field is there and is correct.
  • maybe unsubscribe.php:74 ?
  • Ok. It was just the list settings. Unsubscribe from all.
  • Great that you worked around this so creatively.
This discussion has been closed.