Page 1 of 1
E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 9:08 am
by CASE
Can someone tell me if there is a way to set different confirmation e-mails for specific product types or products within a specific category? We want to set confirmation e-mails to say different things depending on what they purchase.
Thanks!
Re: E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 9:11 am
by mazhar
Yes possible, for this you need to manually trigger Emails. Please read following thread
viewtopic.php?f=42&t=8571
Re: E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 9:23 am
by CASE
I want the e-mail going to the customer to change, based on what they are purchasing. The e-mail to the vendor (there is only one) won't change. Is there any documentation anywhere? I've searched the AbleCommerce site and these archives but haven't found anything. The link provided below doesn't offer the information I neeed.
Re: E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 9:48 am
by mazhar
Could you explain the scenario by some example?
Re: E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 10:18 am
by CASE
Here's an example.
A user can purchase a job posting or a book on our Web site, through the AbleCommerce store. When they purchase a job posting, we want them to receive an order confirmation e-mail with specific contact information and instructions. When they purchase a book, we want them to receive an e-mail with different contact information and instructions. When they purchase a digital product, we want them to receive different instructions. If they purchase one of each, ideally we'd like to include the contact information and instructions for both.
Re: E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 10:45 am
by nickc
Check out ac_ProductCustomFields. You can store text directly against a product and value is available in nVelocity context of email template.
Re: E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 10:48 am
by mazhar
Well one possible solution could be put such product type dependent information in NVelocity conditional code blocks within you template. For example create some new Email template and attach it to Order Placed trigger. Now update its content to look like
Code: Select all
#foreach($orderItem in $order.Items)
#if($orderItem.OrderItemType == "Product")
#if($orderItem.DigitalGoods.Count > 0)
Digital Good Related Info
#else
Normal Product Contact Info (Special Case)
#end
#end
#end
You see in above code snippet in else part I have mentioned that this is special case. Its due to fact that in order relate product special category for example Job, book etc most probably you will be using product templates. So if product is not a digital good then you need to check if it implements some product template or not and if it do so then show appropriate contact info. Finally updated version of Email template could be something like
Code: Select all
#foreach($orderItem in $order.Items)
#if($orderItem.OrderItemType == "Product")
#if($orderItem.DigitalGoods.Count > 0)
Digital Good Related Info
#else
#if($orderItem.Product.ProductTemplateId >0)
#if($orderItem.Product.ProductTemplate.Name == "Book")
Book Contact Info
#end
#if($orderItem.Product.ProductTemplate.Name == "Job")
Job Contact Info
#end
#else
Normal Product Contact Info
#end
#end
#end
#end
Re: E-mail text dependent on product type?
Posted: Thu Apr 09, 2009 10:51 am
by mazhar
nickc wrote:Check out ac_ProductCustomFields. You can store text directly against a product and value is available in nVelocity context of email template.
If you want to proceed with this idea then possible solution could be to just put required text in that basketItem.LineMessage field. In Email template you can access this info on order item as below