Page 1 of 1

Email List Help

Posted: Mon Mar 02, 2009 11:58 am
by heinscott
Hello. I am trying to implement multiple email lists for our site. For some reason, however, if a customer selects to be included on more than one of these lists, they will recieve this message:

Item has already been added. Key in dictionary: 'store'. Key being added: 'store'.

Now, if the same customer checks out once selecting the first list, and a second time selecting the second list, no problems arise at all.
In my dev environment, I can see that this line causes the error:

list.ProcessSignupRequest(email);

BTW, if multiple are selected, they still get added to the email list, even though the error is returned. However, the check-out process appears to hang, even though an order is in fact created.

Any ideas?

Thanks,

Scott

Re: Email List Help

Posted: Tue Mar 03, 2009 8:14 am
by heinscott
Can someone set up an additional email list on their system, and let me know if they experience the same error durring check-out?
Thanks,

Scott

Re: Email List Help

Posted: Tue Mar 03, 2009 8:39 am
by mazhar
Its working for me on the final version of AC7. What are the types for both Email lists.

Re: Email List Help

Posted: Tue Mar 03, 2009 9:07 am
by heinscott
All my email lists are "Opt in with Confirmation", sending the "Email list signup with notification only".

Re: Email List Help

Posted: Tue Mar 03, 2009 9:12 am
by mazhar
I used very same configuration and it worked.

Re: Email List Help

Posted: Tue Mar 03, 2009 9:52 am
by heinscott
Would you know exactly why that error would occur? I have made customizations to the onepagecheckout, so, I have not done the upgrade of that particular file yet. As such, I did try using the upgraded file for checkout, and everything worked correctly. If you had any ideas of what I could look at (as far as changes from one version to the next) I would appreciate it.
Thanks

Scott

Re: Email List Help

Posted: Tue Mar 03, 2009 10:10 am
by mazhar
Check the ProcessSignupRequest call in OnePageCheckout. Make sure its been called only required number of times with valid data.

Re: Email List Help

Posted: Tue Mar 03, 2009 11:27 am
by heinscott
Okay... It seems as though I was wrong. Actually, even with the updated OnePageCheckout running (along with dll updates), it still will return an error when I try to select more than one email list. If I go through the checkout process, and just leave the lists that are currently selected checked, the order will process fine.
Is there something I'm missing here? Perhaps some server setting that needs to be set differently? There is no way for me to get to the guts of the ProcessSignupRequest either. I have a valid Email address for that function, as it does create the right entries. It's just that it also returns that error.
Please help, as I have no idea what to try next!

Scott

Re: Email List Help

Posted: Tue Mar 03, 2009 11:41 am
by heinscott
Mazhar,

As a test, I made a page in my admin section that would just load one of my email lists in question, and add two emails to the list. This produced the same error, as soon as the second time ProcessSignupRequest was called. I have included a screen shot of the page and the error.
emaillisterror.jpg
Both addresses did show up in the email list after continueing to run the program.
Any ideas?
(BTW, thanks for your help so far)

Scott

Re: Email List Help

Posted: Tue Mar 03, 2009 11:47 am
by mazhar
Use different EmailList instance for each sign up instead of a single one which you loaded. For example something like

Code: Select all

EmailList lsit1 = new EmailList();
        lsit1.ProcessSignupRequest("a@a.com");

        EmailList lsit2 = new EmailList();
        lsit1.ProcessSignupRequest("b@b.com");

Re: Email List Help

Posted: Tue Mar 03, 2009 11:54 am
by heinscott

Code: Select all

EmailList lsit1 = EmailListDataSource.Load(9);
    lsit1.ProcessSignupRequest("a@a.com");

    EmailList lsit2 = EmailListDataSource.Load(10);
    lsit1.ProcessSignupRequest("b@b.com");
I just tried this, and recieved the exact same error. This is what I originally tried, too, on my onepagecheckout (as I'm using rules to only allow signup to certain email lists when others are selected).
It seems that any time, for me, that ProcessSignupRequest is called more than once the error occurs.
Anything else we could try? I'm totally stumped!

Scott

Re: Email List Help

Posted: Tue Mar 03, 2009 11:57 am
by mazhar
sorry I made a mistake
It would be something like

Code: Select all

EmailList lsit1 = new EmailList();
        lsit1.ProcessSignupRequest("a@a.com");

        EmailList lsit2 = new EmailList();
        lsit2.ProcessSignupRequest("b@b.com");
or

Code: Select all

EmailList lsit1 = EmailListDataSource.Load(9);
        lsit1.ProcessSignupRequest("a@a.com");

        EmailList lsit2 = EmailListDataSource.Load(9);
        lsit2.ProcessSignupRequest("b@b.com");

Re: Email List Help

Posted: Tue Mar 03, 2009 12:01 pm
by heinscott
Yeah, it's doing the same things still. Not sure if this helps, but, here is the stack trace for the error. (again, thanks a lot for the help).

Code: Select all

Item has already been added. Key in dictionary: 'store'  Key being added: 'store' 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: 'store'  Key being added: 'store'

Source Error: 


Line 17: 
Line 18:     EmailList lsit2 = EmailListDataSource.Load(12);
Line 19:     lsit2.ProcessSignupRequest("b@b.com");
Line 20: 
Line 21: }
 

Source File: c:\Users\Scott\Desktop\ablecommerce\Admin\Reports\RunSomething.aspx    Line: 19 

Stack Trace: 


[ArgumentException: Item has already been added. Key in dictionary: 'store'  Key being added: 'store']
   System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +7482408
   System.Collections.Hashtable.Add(Object key, Object value) +11
   CommerceBuilder.Marketing.EmailList.ProcessSignupRequest(String email) +1251
   ASP.admin_reports_runsomething_aspx.Page_Init(Object sender, EventArgs e) in c:\Users\Scott\Desktop\ablecommerce\Admin\Reports\RunSomething.aspx:19
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnInit(EventArgs e) +99
   System.Web.UI.Page.OnInit(EventArgs e) +12
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
 

Re: Email List Help

Posted: Wed Mar 04, 2009 8:27 am
by heinscott
Does this stack trace (above) mean anything to anybody? Help!!

Scott

Re: Email List Help

Posted: Wed Mar 04, 2009 9:01 am
by heinscott
Couldn't get this to work at all, but, on a positive note, I was able to use AddMember method instead of the ProcessSignupRequest, and it cleared up the error.
Strange.

Code: Select all

list.AddMember(email, DateTime.Now, Request.UserHostAddress);
I can call this method numerous times without getting an error. Not sure why the other should be having a problem...

Scott