Customizing invoice and e-mail templates |
Top Previous Next |
For your invoice and e-mail templates, you can use a whole range of pre-defined and data macros as you can find them at CMSDesk -> Tools -> Ecommerce -> Configuration -> Invoice.
Pre-defined macros
Should you want to replace the current pre-defined macros, you need to enable the usage of the custom e-commerce provider (see Using custom providers for more details) and replace the appropriate method from CustomOrderInfoProvider.
Data macros
You can use data macros to evaluate the data fields of the order and related objects. See 'Kentico CMS Database Reference' for detailed column listing of the objects. Following example displays code of the customer billing address state, however, you can get any value from the related objects: {%BillingAddress.State.StateCode%}
Custom macros
Following example shows how you can display customer total credit and current time in invoice or e-mails, however you can define your own custom macros. Please refer to the Appendix A - Macro expressions chapter in Kentico CMS Developer's Guide fore more details.
E-mail templates
You can manage e-mail templates at CMS Site Manager -> Development -> E-mail templates.
Customizing e-mail subject
Beside e-mail templates, you can use the very same macros in subject of an e-mail. All you have to do is change the appropriate localization strings as specified in the table bellow. You can change the given localization strings at <your web project folder>/CMSResources/CMS.<given UI culture code >.resx (for default culture it's CMS.resx)
Following example shows how to customize subject of the order notifications which are sent to administrator:
1) Go to <your web project folder>/CMSResources/ and open the CMS.resx file.
2) Find the ordernotification.administratorsubject key and change its value to Order with ID {%Order.OrderID%} - {%OrderStatus.StatusDisplayName%} so that the given part of code look in the following way.
This will include information about order ID and order status in the subject of an e-mail send to the administrator.
Default settings of the e-mail subjects
When new order is made or items of the existing one are changed:
When payment is received:
When status of the existing order is changed:
|