Email template configuration

Upasak Majumder asked on April 10, 2019 08:36

In Kentico 10, for an eCommerce application in the email templates configuration I am adding few fields in the email templates which needs to be validated under certain condition.

Shipped Quantity:#quantityShipped# ( Shipped Quantity:#quantityShipped# will be visible if it has some int value or else it will be hidden )

Your items will be shipped via #deliveryMethod# to the address listed below: (#deliveryMethod# will be visible if it has some string value or else it will be hidden )

Your items will be shipped by shippingProvider: #shippingProvider# (shippingProvider: #shippingProvider# will be visible if it has some string value or else it will be hidden)

Your items will be shipped by shippingService : #shippingService# (shippingService : #shippingService# will be visible if it has some string value or else it will be hidden )

Total Shipped Quantity: #sumQuantityShipped# ( Total Shipped Quantity: #sumQuantityShipped# will be visible if it has some int value or else it will be hidden )

Total Cancelled Quantity: #totalCanceledQuantity# ( Total Cancelled Quantity: #totalCanceledQuantity# will be visible if it has some int value or else it will be hidden )

Open Quantity: #openQuantity# (Open Quantity: #openQuantity#will be visible if it has some int value or else it will be hidden )

How can I achieve this logic in HTML ?

Recent Answers


Roman Hutnyk answered on April 10, 2019 10:04 (last edited on December 10, 2019 02:31)

Email templates allow macros and macro allows conditions like this:

{% z = 1; if (z<3) {"z is less than 3"} |(identity)GlobalAdministrator%}

See documentation on macro syntax for more details.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.