E-mail text dependent on product type?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
CASE
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 49
Joined: Tue Jan 22, 2008 7:18 am

E-mail text dependent on product type?

Post by CASE » Thu Apr 09, 2009 9:08 am

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!

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: E-mail text dependent on product type?

Post by mazhar » Thu Apr 09, 2009 9:11 am

Yes possible, for this you need to manually trigger Emails. Please read following thread
viewtopic.php?f=42&t=8571

CASE
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 49
Joined: Tue Jan 22, 2008 7:18 am

Re: E-mail text dependent on product type?

Post by CASE » Thu Apr 09, 2009 9:23 am

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: E-mail text dependent on product type?

Post by mazhar » Thu Apr 09, 2009 9:48 am

Could you explain the scenario by some example?

CASE
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 49
Joined: Tue Jan 22, 2008 7:18 am

Re: E-mail text dependent on product type?

Post by CASE » Thu Apr 09, 2009 10:18 am

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.

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: E-mail text dependent on product type?

Post by nickc » Thu Apr 09, 2009 10:45 am

Check out ac_ProductCustomFields. You can store text directly against a product and value is available in nVelocity context of email template.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: E-mail text dependent on product type?

Post by mazhar » Thu Apr 09, 2009 10:48 am

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


User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: E-mail text dependent on product type?

Post by mazhar » Thu Apr 09, 2009 10:51 am

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

Code: Select all

$orderItem.LineMessage

Post Reply