Whenever I attempt to "add" emails from one of the simplenews newsletters, I only get one email added; the rest are nowhere to be found. It will also add emails from the wrong newsletters. I don't know what could be wrong.

Here is the bit of code that returns the emails, I think. Any help would be really great.

/**
 * Returns a list of members of newsletters created with Simplenews module.
 *
 * @param $rid int The RSVP ID.
 * @return string List of members.
 */
function rsvp_list_simplenews($rid) {
  if (module_exists('simplenews')) {
    $rsvp = rsvp_load($rid);
    $content = t('<h3>You may invite people subscribed to newsletters:</h3>');
    $rows = array();
    $header = array(t('Newsletter name'), array('data' => t('Operations')));

    foreach (taxonomy_get_tree(_simplenews_get_vid()) as $term) {
      $rows[] = array(
        $term->name,
        l(t('Add'), 'node/'. $rsvp->nid .'/rsvp/'. $rsvp->rid .'/attendees/simplenews/'. $term->tid, 
        array('onclick' => "$.get($(this).attr('href'), function(data){ $('#edit-invite-list').val(data); }); return false;")),
      );
    }

Comments

jaynano’s picture

Sorry, here is the whole section for returning the emails.

/**
 * Returns a list of members of newsletters created with Simplenews module.
 *
 * @param $rid int The RSVP ID.
 * @return string List of members.
 */
function rsvp_list_simplenews($rid) {
  if (module_exists('simplenews')) {
    $rsvp = rsvp_load($rid);
    $content = t('<h3>You may invite people subscribed to newsletters:</h3>');
    $rows = array();
    $header = array(t('Newsletter name'), array('data' => t('Operations')));

    foreach (taxonomy_get_tree(_simplenews_get_vid()) as $term) {
      $rows[] = array(
        $term->name,
        l(t('Add'), 'node/'. $rsvp->nid .'/rsvp/'. $rsvp->rid .'/attendees/simplenews/'. $term->tid, 
        array('onclick' => "$.get($(this).attr('href'), function(data){ $('#edit-invite-list').val(data); }); return false;")),
      );
    }

    if (count($rows) == 0) {
      $rows[] = array(array('data' => t('There are currently no newsletter series.'), 'colspan' => 2));
    }
    $content .= theme('table', $header, $rows);
    return $content;
  }
}
owahab’s picture

Assigned: Unassigned » owahab
Status: Active » Postponed (maintainer needs more info)

Could you please provide the versions of Simplenews and RSVP?

jaynano’s picture

I'm using RSVP version 5.x-1.2, and Simplenews version 5.x-1.1. I noticed that when I do a manual export in simplenews (using the feature provided by simplenews), it returns the emails in this format: email@domain.net, email@domain.net, email@domain.net, etc... (seperated by commas). And RSVP asks to input the emails line by line. I don't know if that has anything to do with it.

owahab’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for the useful info.
Working on it.

owahab’s picture

Version: 5.x-1.2 » 5.x-1.x-dev
Status: Active » Fixed

Committed. Thanks for your persistence.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.