2

I'm hoping this is a simple question to answer ...

How do I download an ExpressionEngine mailing list?

I can easily add emails to an existing or new mailing lists however I can not work out how to download a list (in a spreadsheet or similar).

0

1 Answer 1

4

You should be able to do this with the query module in a template (or with a query directly to your database, of course).

Something simple like this should output what you need:

{exp:query sql="SELECT email FROM exp_mailing_list WHERE list_id = '1'"}
{email}
{/exp:query}

EDIT

To improve this furher, you could use the Download Content plugin like this:

{exp:download_content filename="list.csv"}
    {exp:query sql="SELECT email FROM exp_mailing_list WHERE list_id = '1'"}
    {email}
    {/exp:query}
{/exp:download_content}

This should make the list download as a CSV file which can open in Excel. You may need to tinker with the spacing a bit (like removing the tabs) so you don't get blank lines in the file.

4
  • That's awesome, thanks Jeremy! I just wish there was a better way to output the mailing list eg. Spreadsheet.
    – Dan
    Commented Nov 16, 2013 at 8:20
  • Just posted an edit that should help. Commented Nov 16, 2013 at 15:51
  • 2
    For posterity's sake, some additional tips on generating spreadsheets can also be found in What is the best method for exporting channel entries as a spreadsheet?. I've found that it can even be as simple as outputting an html table, saving the webpage, and then opening with Excel.
    – Alex Kendrick
    Commented Nov 18, 2013 at 5:29
  • That's awesome, thanks heaps for the edit @JeremyGimbel! It's greatly appreciated!
    – Dan
    Commented Nov 23, 2013 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.