1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to export member emails seperated by a comma?

Discussion in 'XenForo Questions and Support' started by TNCclubman, Mar 12, 2011.

  1. TNCclubman

    TNCclubman Well-Known Member

    I want to generate a .txt file with all the users emails (between certain dates) and each one seperated by a comma. I currently do it in vB and import it into my phplist software for newsletters.

    In xF, it generates a list, but its

    email username
    email username

    etc.

    Any idea how to get it to output in a different way? Even set the seperation syntax to other things besides a comma.

    Thanks!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    There isn't a way to do it from the ACP but you can manipulate the list in Excel easily enough to split the data into 2 coloumns, add a comma and then produce a list.

    The other option would be to grab the email addresses directly from the database.
     
  3. Mike

    Mike XenForo Developer Staff Member

    It's tab separated, because it can be easily brought into Excel, or taken directly to something like MailChimp (they support tab delimited files directly).
     
  4. TNCclubman

    TNCclubman Well-Known Member

    can we have an option before it generates the page?

    [] comma
    [] tab
     
  5. TNCclubman

    TNCclubman Well-Known Member

    Im not too comfortable with excel to be able to do that.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    I'm happy to do it for you if you provide the file and the exact format you want.
     
  7. TNCclubman

    TNCclubman Well-Known Member

    I know phplist is the most popular mailing list software, has anyone had success exporting the emails from xF and into phplist?

    What settings do you enter on the phplist side? How do you disregard the usernames from the emails?
     
  8. TNCclubman

    TNCclubman Well-Known Member

    Thanks for the offer Brogan, but it wont be a one time thing. I have to do it every few weeks to keep my mailing list up to date as the phplist and xenforo arent synched together live.
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    No worries.
    It would even be possible to build a template in Excel so all you would have to do is paste in the output from the ACP.
     
  10. snoopy5

    snoopy5 Well-Known Member

    I would be interested in this. Has someone achieved to make this excel template for a regular and easy export/import from XF into phpList?
     
  11. Luke F

    Luke F Well-Known Member

    Code:
    set group_concat_max_len = 99999999;
    select group_concat(email) from xf_user where email <> ''
    
     
    Brandon Sheley likes this.
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can export a list using phpmyadmin. Run this query using phpmyadmin:

    Code:
    SELECT username, email
    FROM xf_user;
    
    If you want to save the results then click Export at the bottom of the page in phpmyadmin after you run the query. It will give you lots of format options.
     
  13. snoopy5

    snoopy5 Well-Known Member


    Thanks.

    How do I have to enhance this code, if I want to export only email addresses of valid users (verified email addresses) and users who are not banned?
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
    SELECT username, email
    FROM xf_user
    WHERE user_state = 'valid';
    
     
    snoopy5 and Brandon Sheley like this.

Share This Page