Page 1 of 1

Email List Export Timeout

Posted: Mon Apr 11, 2011 11:22 am
by amgym-jt
I am currently unable to export current members of my email list because the server times out. I export them so that i can add them to my external list that is maintained with a 3rd party source. There are only just over 1000 in this list. I tried accessing the data with the dataport, but the user information downloaded does not include list membership info.

Any suggestions?

Thanks!

Jay

Re: Email List Export Timeout

Posted: Tue Apr 12, 2011 8:08 am
by mikek
Hi Jay,

The default exportlist functionality tries to find customer address information for each email in the list and times-out if you have
more than few hundred emails.

If you just need to export email addresses with no additional information you can use the code listed below.

- go to [site physical path] \Admin\Marketing\Email\ and make a copy of ExportList.ashx
- open ExportList.ashx with any text editor and replace code with code listed below
- save the file a try to export emails again

\Admin\Marketing\Email\ExportList.ashx

Code: Select all

<%@ WebHandler Language="C#" Class="ExportList" %>

using System;
using System.Web;
using System.Text;
using CommerceBuilder.Marketing;
using CommerceBuilder.Users;
using CommerceBuilder.Utility;

public class ExportList : IHttpHandler {

    public void ProcessRequest(HttpContext context)
    {
        int _EmailListId = AlwaysConvert.ToInt(context.Request.QueryString["EmailListId"]);
        EmailList _EmailList = EmailListDataSource.Load(_EmailListId);
        
        if (_EmailList.Users.Count > 0)
        {
            StringBuilder userData = new StringBuilder();
            userData.Append("Email\r\n");
            
            foreach (EmailListUser elu in _EmailList.Users)
            {
                userData.Append(string.Format("{0}\r\n", elu.Email));
            }
            
            string outFileName = "email_list.csv";
            PageHelper.SendFileDataToClient(userData.ToString(), outFileName);
        }
    }
 
    public bool IsReusable {
        get {
            return true;
        }
    }

}

Re: Email List Export Timeout

Posted: Thu Apr 28, 2011 12:27 pm
by amgym-jt
that worked like a charm! thanks!

any way that we can keep the customer's first name too in the export list?

thanks again!

Jay

Re: Email List Export Timeout

Posted: Mon Nov 28, 2011 1:01 pm
by crazyjoe
Thanks for this! I need to export with zip code if possible. Let me know if anyone can help with this. Thanks.