Email List Export Timeout

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
amgym-jt
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Mon Mar 17, 2008 12:35 pm

Email List Export Timeout

Post by amgym-jt » Mon Apr 11, 2011 11:22 am

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

User avatar
mikek
Commander (CMDR)
Commander (CMDR)
Posts: 112
Joined: Wed Oct 15, 2008 9:30 pm
Location: Boston, MA
Contact:

Re: Email List Export Timeout

Post by mikek » Tue Apr 12, 2011 8:08 am

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;
        }
    }

}
Mike Kolev

amgym-jt
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Mon Mar 17, 2008 12:35 pm

Re: Email List Export Timeout

Post by amgym-jt » Thu Apr 28, 2011 12:27 pm

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

crazyjoe
Commander (CMDR)
Commander (CMDR)
Posts: 172
Joined: Mon Apr 26, 2010 2:20 pm

Re: Email List Export Timeout

Post by crazyjoe » Mon Nov 28, 2011 1:01 pm

Thanks for this! I need to export with zip code if possible. Let me know if anyone can help with this. Thanks.
Crazy Joe Sadloski
Webmaster
Hot Leathers Inc.
http://www.hotleathers.com

Post Reply