You are here

function simplenews_get_user_subscription in Simplenews 5

API function; returns the subscription for the given e-mail address.

5 calls to simplenews_get_user_subscription()
simplenews_subscribe_user in ./simplenews.module
API function; subscribes a user to a newsletter.
simplenews_subscription_manager_form in ./simplenews.module
Generates the subscription form for users.
simplenews_subscription_manager_form_validate in ./simplenews.module
Forms API callback; validates the settings form.
simplenews_unsubscribe_user in ./simplenews.module
API function; unsubscribes a user from a newsletter.
simplenews_user in ./simplenews.module
Implementation of hook_user().

File

./simplenews.module, line 891

Code

function simplenews_get_user_subscription($mail) {
  $account = _simplenews_user_load($mail);
  $snid = db_result(db_query("SELECT snid FROM {simplenews_subscriptions} s WHERE s.mail = '%s' AND s.uid = %d", $account->mail, $account->uid));
  return simplenews_get_subscription($snid);
}