Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: Send copy of receipt to admin on every order.

  1. #1
    junosapien is offline Junior Member
    Join Date
    Feb 2013
    Posts
    4

    Default Send copy of receipt to admin on every order.

    I've seen a couple of threads on this, but none quite give me the answer I am looking for.

    This one comes closest.

    Following that thread, I edited ASPDNSFcore/Applogic.cs and changed String.Empty to AppLogic.AppConfig("GotOrderEMailTo") on line 9904.

    The line now reads:
    SendMail(subject, body, useHTML, AppLogic.AppConfig("MailMe_FromAddress"), AppLogic.AppConfig("MailMe_FromName"), AppLogic.AppConfig("MailMe_ToAddress"), AppLogic.AppConfig("MailMe_ToName"), AppLogic.AppConfig("GotOrderEMailTo"), AppLogic.MailServer());
    However, we still do not receive a copy of the receipt. Obviously, I have either edited the wrong line OR entered the wrong value. Can someone point me in the right direction? Thanks!

  2. #2
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    I've made a similar modification and it works just fine (actually I'm sending a copy of the order to my affiliates). Interestingly enough, you shouldn't have to do this as there is another setting that will copy all emails to the admin. Check the Email option under the Configuration menu and you'll see an option to have new order notifications copied to an address of your choosing.

    Also, what is the GotOrderEMailTo AppConfig set to?
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  3. #3
    junosapien is offline Junior Member
    Join Date
    Feb 2013
    Posts
    4

    Default

    Here's a screen grab of our email configuration:
    Name:  Screen Shot 2013-05-29 at 9.20.42 AM.jpg
Views: 13
Size:  22.8 KB

    This works just fine. What I want is a CC or BCC sent to sales@sapien.com on the Receipt email that goes to the customer (the first email section in the configuration.) I do not see a place in the Receipt email section that allows a CC or BCC.

    I have also tried setting the AppConfig XmlPackage.NewOrderAdminNotification to notification.receipt.xml.config (from notification.adminneworder.xml.config). This was almost working, except that it wasn't sending the Customer Order Notes in the email to the Admin (it DID send the notes in the email to the customer.) So - What I really want to do is just CC/BCC sales@sapien.com on the email to the customer.

    Seems like it really shouldn't be this hard.

  4. #4
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    It seems that what you are doing should work. Have you tried stepping through the code? I suppose it could be that there are two similar looking lines, and stepping through the could could identify that. I would actually search the entire code-base for calls to SendMail and put a break-point on all of them and see which one gets called when you place an order.
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM

  5. #5
    junosapien is offline Junior Member
    Join Date
    Feb 2013
    Posts
    4

    Default

    Hi cjbarth,

    Thanks - I have it working now. There are three different instances of 'static public void SendMail() in AppLogic.cs. The one I needed was on line 9914. Within it is this code:

    if (bccaddresses.Length != 0)
    {
    MailAddressCollection mc = new MailAddressCollection();
    foreach (String s in bccaddresses.Split(new char[] { ',', ';' }))
    {
    if (s.Trim().Length > 0)
    {
    msg.Bcc.Add(new MailAddress(s.Trim()));
    }
    }
    }
    so - I added this:
    else
    {
    msg.Bcc.Add(AppLogic.AppConfig("GotOrderEMailTo")) ;
    }
    And now it works!

    I figure this way if we ever want additional Bccs, we can add them by passing in the appropriate string.
    Thanks again.