Sometimes you write messages where your refer to an unknown quantity. For example, you don't know how many orders a customer has, or how many tickets. It could be one, or it could be more.

This can lead to ungrammatical sentences like this one:

Your booking reference is 18-DU20-10, 18-UI38-39 and 18-LH59-22.

crowdEngage contains a nifty pluralisation function to let you specify both the singular and plural versions of a word or phrase. Then, at the time of sending, the system will insert the correct one automatically.

The template tag

The template tag is used like this:

{{ pluralise("singular form", "plural form", object_to_count) }}

(Where object_to_count is a valid crowdEngage variable containing a list of items, for example orders or tickets.)

Example

Your booking {{ pluralise("reference is", "references are", order.orders) {{ order.friendly_ids }}.

For a message with just a single order, this templating code would output:

Your booking reference is 18-LH59-22.

However if the message was for multiple orders, it would output:

Your booking references are 18-DU20-10, 18-UI38-39 and 18-LH59-22.

Objects with which the pluralise tag can be used

Primarily, this can be used with the list of orders ( order.orders ). It can also be used with the list of tickets ( order.tickets ). There are various other lists (for example membership subscriptions) with which you can also use this tag. Please contact support on support@crowdengage.com for more information and help.

Did this answer your question?