Preview
Error: Unable to find the details for this template.
Custom Filters
Useful custom filters to help with email formatting
currentDate(<format>)
As the name suggests, it gets the current date. Note this will be the server date. The function will return a Date object by default, putting 'string' as the format will return the value as text instead.
convertToDate
Convert the string the filter is run on into a Date object (where possible).
totalCost(<onlyBeforeCurrentDate>)
Calculates the total of the cost sub-fields in an array of events. The onlyBeforeCurrentDate parameter is a boolean value (true/false)
that controls whether all events or only those that have a datetime prior to today (midnight) are included in the calculation e.g.
person.unpaid_events|totalCost(true)
getNextDay(<dayname>)
Calculate the date of the next day with the supplied day name from the initial date, e.g.
currentDate()|getNextDay('sunday') would get a datetime of the next Sunday.
applyDays(<numDays>)
Add or subtract the supplied number of days from the initial date, e.g.
currentDate()|applyDays(-2) would calculate the datetime of two days ago.
formatDate(<format>)
Formats the supplied datetime to the format requested, e.g.
currentDate()|formatDate('Do MMM') would result in a date like 9th Nov.
Supported tokens in a format are:
| Token | Description |
|---|---|
| DD | Two-digit zero-filled date, i.e. 19 or 07 |
| D | The date, i.e. 19 or 7 |
| MMMM | The full month name, i.e. January |
| MMM | The short month name, i.e. Jan |
| MM | Two-digit zero-filled month number, i.e. 12 or 02 |
| M | The month number, i.e. 12 or 2 |
| YYYY | The full year, i.e. 2023 |
| YY | Two-digit year, i.e. 23 |
| o | The ordinal of a date, i.e. st for the 1st, or nd for the 2nd |
Template Data
The data exposed to a template will vary depending on the context, but will generally include the following:
Person
| Field | Type | Description |
|---|---|---|
| firstname | string | The person's first name |
| lastname | string | The person's last name |
| nickname | string | The person's nickname |
| array | The person's email addresses | |
| phone | array | The person's phone numbers |
| total_owing | float | The current total of outstanding monies owed |
| balance | float | The person's current balance |
| unpaid_events | array | Details of each unpaid event that include: description, cost, datetime |
Event
| Field | Type | Description |
|---|---|---|
| description | string | The name of the event |
| datetime | string | The date and time of the event |
| cost | float | The event's cost |
| attendees | array | A list of each attendee that includes: name (the person's first or nickname), paid (the paid status true/false) |
| waitlist | array | A list of each person waiting for a spot that includes: name (the person's first or nickname) |
| tentatives | array | A list of each person who may attend that includes: name (the person's first or nickname) |