Newsletter plugin - View subscribers in Mailing list
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 10, 2014 (RSS)
By gversion - March 6, 2014
Hello,
I am struggling to see which subscribers belong to a certain mailing list.
When I open a subscriber's record I can see which mailing lists they belong to, however when I open a mailing list record I would like to be able to see a list of the subscribers.
Can this be achieved using the related records plugin somehow?
Thank you for your help.
Regards,
Greg
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.
interactivetools.com