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 10 of 10

Thread: New Customer Notification to Admin

  1. #1
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default New Customer Notification to Admin

    This procedure will enable your main site to send an email to whatever is specified in the MailMe_ToAddress (usually the merchant's email address) whenever a new customer is created. First, we will need to add an AppConfig, let's say, NewCustomerEmailNotification, set its value to true. This would serve as a switch for enabling this feature or not. Then look for the following if block statement on createaccount.aspx.cs:
    Code:
    if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
    {
    // don't let a simple welcome stop checkout!
         try
        {
               AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting), AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"), null, ThisCustomer, this.SkinID, "", "", false, false, this.EntityHelpers), true, AppLogic.AppConfig("MailMe_FromAddress"), AppLogic.AppConfig("MailMe_FromName"), EMailField, FirstName.Text.Trim() + " " + LastName.Text.Trim(), "", AppLogic.MailServer());
        }
        catch { }
    }
    Then add the following codes next to it:
    Code:
    if(AppLogic.AppConfigBool("NewCustomerEmailNotification"))
    {
         try
         {
              AppLogic.SendMail("New Customer Notification","You have a NEW Customer. Customer ID:" + ThisCustomer.CustomerID.ToString(), true, AppLogic.AppConfig("MailMe_FromAddress"), AppLogic.AppConfig("MailMe_FromName"),AppLogic.AppConfig("MailMe_ToAddress"), AppLogic.AppConfig("MailMe_ToName")," ",AppLogic.MailServer());
         }
         catch{ }
    }
    Last edited by Jao; 04-21-2009 at 11:38 AM.

  2. #2
    babslimo is offline Member
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    67

    Default New Customer Notification

    This is just exactly what I needed-- thanks! I just need a little more guidance, if you don't mind... I have the code pointing to a new xml package "notification.newmemberwelcome2.xml" to format the email, and I'd like to pull some of the form fields (customer name, city, state, etc.) onto the email, but I haven't done that before. If you can point me to an example of how to display one form field, I think I can figure out the rest! THANKS again!

  3. #3
    babslimo is offline Member
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    67

    Default Multiple emails

    Ok, got the XML formatting issue above worked out, but now need help with sending the message to multiple addresses. We don't have access to the client's email server and aren't sure they will be able to set up a distribution group, so we are trying to figure out a way to send this notification to multiple email addresses.

    Apparently the MailMe_ToAddress doesn't handle comma-separated values, because it only sends to the first email address in the list. Then we tried using the GotNewOrderEmail value, but that appears to only send to the first address as well. Am I missing something?

    AppLogic.SendMail("You have a new State Contract customer", AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPack age.WelcomeEmail2"), Nothing, ThisCustomer, Me.SkinID, "", "fullname=" & FirstName.Text.Trim() & " " & LastName.Text.Trim(), False, False, Me.EntityHelpers), True, AppLogic.AppConfig("MailMe_FromAddress"), AppLogic.AppConfig("MailMe_FromName"), AppLogic.AppConfig("GotOrderEMailTo"), "Macthrift State Reps", "", AppLogic.MailServer())

  4. #4
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    You may try using the Split method to extract email addresses separated by a comma and then create a loop statement to the SendMail passing each extracted email address to a variable that would eventually be tossed to the MailMe_ToAddress parameter.
    Last edited by Jao; 06-30-2009 at 02:08 PM.

  5. #5
    bpo is offline Junior Member
    Join Date
    Jun 2007
    Posts
    24

    Default all form fields in new customer notification email

    Is there a way to put all registration form fields in the new customer notification email without using xml package, similar to contact form or lat_signup.aspx?

    Thank you!

  6. #6
    baba is offline Senior Member
    Join Date
    Dec 2008
    Posts
    123

    Default

    Thanks. This is eactly what we are looking for.,

    Take Care

    B-A-B-A

  7. #7
    sohan is offline Member
    Join Date
    Jun 2009
    Posts
    33

    Default Notification

    This exatcly what I am looking for.

    Thank you.

  8. #8
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    How is this accomplished in v9
    I would also like to use a different xml.config and address for the email sent to the admin
    MSX

  9. #9
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Just follow exactly what Jao told you to do, that should work the same. As for using a different XML, from the SendMail overload you'll have to change AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPack age.WelcomeEmail") to your custom XML.

  10. #10
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    I still want to use XmlPackage.WelcomeEmail for the customer welcome mail.
    I just want to use a different one for the admin notification
    MSX