Newsletter plugin - View subscribers in Mailing list

By Dave - March 10, 2014

Hi Greg, 

>when I open a mailing list record I would like to be able to see a list of the subscribers.

We don't have a feature built in for that yet but you can try adding a separator field with the following PHP code to the "_nlb_lists" section:

You can add this as a separator field with the following HTML: 

<tr>
 <td>Emails: </td>
<td>
<?php
   $listNum = (int) $RECORD['num'];
   $subscriberTable = nlb_subscriber_table();
   $emailField = $GLOBALS['NLB_ALT_ENABLED'] ? $GLOBALS['NLB_ALT_FIELD_EMAIL'] : 'email';
  $query = "SELECT s.*, s2l.listNum
FROM {$TABLE_PREFIX}_nlb_subscribers2lists s2l
LEFT JOIN  {$TABLE_PREFIX}$subscriberTable s
ON s2l.subscriberNum = s.num
WHERE s2l.listNum = $listNum";
$records = mysql_select_query($query); 

foreach ($records as $record) { 
  print $record[$emailField] . ", "; 
}
?>
 </td>
</tr>

That should give you a comma separated list of emails.

Let me know if that works for you.

Dave Edis - Senior Developer

interactivetools.com