Customizing Email Templates

From AbleCommerce Wiki
Revision as of 03:58, 2 September 2008 by Mazhar (Talk | contribs)

Jump to: navigation, search

Merchants can fully customize the customer notification email. It can include plain text, static HTML, and even dynamic information with the help of the full fledged template engine.

NVelocity is used as the template engine to process the email templates. Templates are written in velocity template language (VTL), which is extremely simple and powerful.

In a velocity template, certain objects put in the velocity context, can be accessed directly in a straight forward manner. For example if a ‘Store’ object, named “store” is available in the context, then using $store.Name we will get the name of the store. Similarly any method available in the ‘Store’ object can be called directly.

While writing templates for email messages in AbleCommerce, certain objects are automatically made available to the context, depending on the type of event.

The following table illustrates the objects and their availability for different events.

Object     Type              	                   Available To

store      CommerceBuilder.Stores.Store            All Events

order      CommerceBuilder.Orders.Order            OrderStatusUpdated, PaymentAuthorized,
                                                   PaymentCaptured, PaymentCapturedPartial,
                                                   PaymentCaptureFailed, OrderPlaced, OrderCancelled,
                                                   OrderPaidPartial, OrderPaid, OrderPaidNoShipments,
                                                   OrderPaidCreditBalance, ShipmentShipped, 
                                                   OrderShipped, OrderShippedPartial,  
                                                   GiftCertificateValidated, OrderNoteAddedByCustomer