is there a way to find how many users unsubscribed from my Simplenews newsletter at my Drupal-7 website? And, if yes, can I detect from which particular newsletter did the user unsubscribe from?
You can click admin/people/simplenews and check on status column. OR you can use following code to get the data
// fetching from the database. $query = db_select('simplenews_subscriber', 'ss'); $query->innerJoin('simplenews_subscription', 'si', 'si.snid = ss.snid'); $query->fields('ss', array('mail')) ->condition('ss.activated', $condition_active) ->condition('si.status', $condition_subscribed) ->condition('si.newsletter_id', $newsletters) ->distinct(); $data = $query->execute()->fetchAll();
si.status is a flag indicating whether the user is subscribed (1) or unsubscribed (0)
$newsletters is a Array of newsletter ids to filter on