Email Template for Product Promotions
Email Template for Product Promotions
How to create email template for promotional Products .Is that possible to create custom email templates using Nvelocity for product listing...........
Check the attachment image for example....................
Regards,
Pat
Check the attachment image for example....................
Regards,
Pat
Re: Email Template for Product Promotions
Yes its possible. Please have a look at following thread
viewtopic.php?f=42&t=8571
It will explain how you can set NVelocity parameters for Email templates and how to send Emails manually. All you need is to create an Email template, adjust template layout and product dispaly using your custom NVelocity parameter for example for all those promoted products you can send some $promotedproducts parameter having all those products.
viewtopic.php?f=42&t=8571
It will explain how you can set NVelocity parameters for Email templates and how to send Emails manually. All you need is to create an Email template, adjust template layout and product dispaly using your custom NVelocity parameter for example for all those promoted products you can send some $promotedproducts parameter having all those products.
Re: Email Template for Product Promotions
Here is the template file which could be used for this sort Email list operations. Unzip it and place it under Website/App_Data/EmailTempaltes/1/ folder. Then go to Administration > Configure > Email > Templates and create a new Email Template and assign it newly placed file for message body.
This Email template is general purpose I just put the logic how to render the products. Currently it will render complete store products, because I don't know how you are handling your promotions. You can update template code to output only those products that meet your promotion criteria.
This Email template is general purpose I just put the logic how to render the products. Currently it will render complete store products, because I don't know how you are handling your promotions. You can update template code to output only those products that meet your promotion criteria.
Re: Email Template for Product Promotions
Thanks Mazhar this is really helpful for me to develop further..... this is what i m looking for .....
Now i m working in Nvelocity to list promotional products ........
Thanks once again
Best Regards,
Pat
Now i m working in Nvelocity to list promotional products ........
Thanks once again
Best Regards,
Pat
Re: Email Template for Product Promotions
Hi mazhar , i m sending a Nvelocity parameter to render products with special offers and generating list ,it works fine. But if i m sending it from the email list option(in admin side) will it work.
Regards,
Pat
Regards,
Pat
Re: Email Template for Product Promotions
For this you need to make a change to marketing pages in admin side. In fact you need to put your custom NVelocity variable in Email template. For this editPat_king wrote:Hi mazhar , i m sending a Nvelocity parameter to render products with special offers and generating list ,it works fine. But if i m sending it from the email list option(in admin side) will it work.
Regards,
Pat
Code: Select all
Admin/Marketing/Email/Preview.aspx.cs
Code: Select all
protected void PreviewButton_Click(object sender, System.EventArgs e)
{
//GENERATE MESSAGE
EmailTemplate listTemplate = GetTemplate();
listTemplate.Parameters["store"] = Token.Instance.Store;
if (_EmailList.Users.Count > 0)
{
listTemplate.Parameters["customer"] = UserDataSource.LoadMostRecentForEmail(_EmailList.Users[0].Email);
}
listTemplate.Parameters["list"] = _EmailList;
//Here will be your code to find out products you want to send in promotion Email and finally add them as NVelocity parameter
listTemplate.Parameters["promotionproducts"] = Token.Instance.Store.Products;
listTemplate.ToAddress = _EmailList.Users[0].Email;
System.Net.Mail.MailMessage[] messages;
try
{
messages = listTemplate.GenerateMailMessages();
}
catch(Exception ex)
{
EmailTemplateErrorLabel.Text = String.Format(EmailTemplateErrorLabel.Text,listTemplate.Name, ex.Message);
EmailTemplateErrorLabel.Visible = true;
return;
}
System.Net.Mail.MailMessage message = messages[0];
PreviewFromAddress.Text = message.From.ToString();
//PreviewToAddress.Text = ToAddress.Text + " (" + message.To + ")";
PreviewToAddress.Text = ToAddress.Text;
PreviewSubject.Text = message.Subject;
PreviewMessage.Text = message.Body;
if (message.IsBodyHtml)
{
PreviewMessage.Text = message.Body;
}
else
{
PreviewMessage.Text = "<PRE>" + Server.HtmlEncode(message.Body) + "</PRE>";
}
//SWAP THE PANELS
CustomizePanel.Visible = false;
PreviewPanel.Visible = true;
}
Code: Select all
//Here will be your code to find out products you want to send in promotion Email and finally add them as NVelocity parameter
listTemplate.Parameters["promotionproducts"] = Token.Instance.Store.Products;
Re: Email Template for Product Promotions
Hi mazhar, I assigned the parameter in the preview file, on clicking the preview button it shows the promotional products .But it is not getting displayed in the email. I m unable to figure out the problem.
Regards ,
Pat
Regards ,
Pat
Re: Email Template for Product Promotions
May be you have disabled image display in your Email account.
Re: Email Template for Product Promotions
No i enabled image display, loop to render products is not working mazhar.........
Last edited by Pat_king on Tue Jun 30, 2009 5:15 am, edited 1 time in total.
Re: Email Template for Product Promotions
Make sure that your NVelocity code is good and is working. Also could you provide your custom code where you are passing Nvelocity parameter to Email template. May be its not working when it comes to Email list.
Re: Email Template for Product Promotions
Hi mazhar, problem with parameter name.i got that right, now its working, thanks once again for your help...cheers
Best Regards,
Pat
Best Regards,
Pat
Re: Email Template for Product Promotions
Sounds good