We need two new email triggers for the site if anyone is available to help.We want triggers for:
-When a customer Registers, not for verification, but just a welcome email.
-When an order is switched to "sent to warehouse".
What code do I need to put where so that I can do this?
New Email Triggers
- William_firefold
- Commander (CMDR)
- Posts: 186
- Joined: Fri Aug 01, 2008 8:38 am
Re: New Email Triggers
Well as discussed before in some other threads it is not possible to create new triggers so that store can send notifications based upon them. You have to load and send Email template manually from the location where action is performed. For example if want to send the Email notification when some customer is registered you need do the following.
1)- Create a new Email Template
For this go to admin side and create a new Email template for example just say it "New Registration" and specify its subject as below
Subject: Registration at $store.Name
and contents as
Contents: Hello, $customer.UserName welcome to $store.Name
and save this template.
2)- Email Code
In this step first I loaded the desired template and then i need two NVelocity parameters which i used in the Email Template the store and customer, Then i provided the ToAddress where i want to send the Email.
You will provide this code where the registeration is being done in this case it will be in RegisterDialog conlib control. You can place the code just above the following line in this control
You can create the other one using the same technique.
1)- Create a new Email Template
For this go to admin side and create a new Email template for example just say it "New Registration" and specify its subject as below
Subject: Registration at $store.Name
and contents as
Contents: Hello, $customer.UserName welcome to $store.Name
and save this template.
2)- Email Code
Code: Select all
EmailTemplateCollection emailTemplates = EmailTemplateDataSource.LoadForCriteria(" Name = 'New Registration' ");
if (emailTemplates.Count > 0)
{
emailTemplates[0].Parameters.Add("store", Token.Instance.Store);
emailTemplates[0].Parameters.Add("customer", newUser);
emailTemplates[0].ToAddress = newUser.UserName;
emailTemplates[0].Send();
}
You will provide this code where the registeration is being done in this case it will be in RegisterDialog conlib control. You can place the code just above the following line in this control
Code: Select all
//REDIRECT TO APPROPRIATE PAGE
FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
- William_firefold
- Commander (CMDR)
- Posts: 186
- Joined: Fri Aug 01, 2008 8:38 am
Re: New Email Triggers
Perfect. Thank you for your reply. This should work great.
Login Redirect
How do I control where
FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
is redirected?
A common confusion is when a customer has logged in, they don't realize it because the logged in page is so similar. I would like to redirect to their member account page for example or a welcome screen with their name.
Thanks.
FormsAuthentication.RedirectFromLoginPage(UserName.Text, false);
is redirected?
A common confusion is when a customer has logged in, they don't realize it because the logged in page is so similar. I would like to redirect to their member account page for example or a welcome screen with their name.
Thanks.
Re: New Email Triggers
Try following trick
Edit your website/web.config file and then locate following line
and change it as below
Edit your website/web.config file and then locate following line
Code: Select all
<forms timeout="90" slidingExpiration="true" name="AC7.ASPXAUTH" />
Code: Select all
<forms timeout="90" slidingExpiration="true" name="AC7.ASPXAUTH" defaultUrl="~/Members/MyAccount.aspx"/>
Re: New Email Triggers
Excellent! Worked Perfectly. Thanks.