cliveportman/code

Download mailing list from ExpressionEngine as CSV file

Slap this baby in a template and download the resulting .csv file…

<?php
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename="mailing-list.csv"');
?>
{exp:query sql=”select email from exp_mailing_list where list_id = ’2′ order by email asc”}
    email@domain.com
{/exp:query}