Have A Copy of New User Welcome Message Sent to You (ASPDotNetStoreFront)
ASPDNSF Version: 9 (C# + MS SQL)
If you would like to have a copy of the new user welcome email message sent to you whenever a new user signsup to your shop, well you'd assume they would have this feature in the system already...but that's not the case. This feature is currently lacking in AspDotNetStorefront as of version 9 (ML).
No fear, Ben is here!
To enable this feature it will take a bit of C# work and some tinkering.
First, open up createaccount.aspx.cs using your favorite text editor. Then find the lines of code where the welcome message is sent to the new user...
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(...
Now, add the following code after the try and catch...
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"youremail@yourdomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
...being sure to change "youremail@yourdomain.com" to the email address where you want to receive the notifications.
Example:
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
EMailField,
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}
catch { }
// below added by Benjamin Eskew (Aug 25, 2010)
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"myemail@mydomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
// the above added by Benjamin Eskew (Aug 25, 2010)
}
Now save the file and upload it to your server and that's that! Do realize that this is just a simple copy of the message, not a custom message sent to the administrator. In order to make something like that you'll have to create a custom XmlPackage to handle it and use that one in place of the current one in use (XmlPackage.WelcomeEmail).
As you can see from my current and previous posts, I've been working a lot with AspDotNetStorefront lately and have plans to continue posting information articles like this one here, so stay tuned!
Make Breadcrumbs in AspDotNetStorefront template.master
ASPDNSF Version: 9 (C# + MS SQL)
If you've not gone through every nook and cranny of the AspDotNetStorefront manual chances are that you haven't figured out how to properly create "breadcrumbs" with your navigation.
No fear, Ben is here.
In your template.master skin file, located at "App_Templates/Your_Skin_Folder/template.master", simply add the following immediately after the opening id="content" DIV:
<div id="breadcrumbs">
<a href="http://www.yoursite.com/default.aspx">HOME</a> ::
<asp:Literal ID="SectionTitle" runat="server" Text='' />
</div>
ex.
...
<div id="content">
<!-- CONTENTS START -->
<div id="breadcrumbs">
<a href="http://www.yoursite.com/default.aspx">HOME</a> ::
<asp:Literal ID="SectionTitle" runat="server" Text='' />
</div>
<asp:ContentPlaceHolder ID="PageContent" runat="server">
</asp:ContentPlaceHolder>
<!-- CONTENTS END -->
</div>
...
Although, you don't absolutely NEED to add it within the content DIV, I just placed it there because it's the top-most element within the content column in the layout. Technically, you can add it anywhere you'd like within the template.master file.
