Templates
Custom Message Templates
Custom message templates allow you to specify how your Discord event messages are formatted and which data fields are included.
Creating Templates
When building a custom Reminder Template you can insert a variety of special data fields, which the bot uses to determine where to insert the desired event data. A data field must be enclosed in a double set of curly braces. For example, if you wanted to insert the event's title, you would type:
{{.Title}}
A set of template functions that work with the parameters you specify is also available. For example, if you would like to use an event's description but only the first 40 characters, you can truncate the description using the following:
{{truncate .Description 40}}
Reminder Templates
Reminder message templates customize your event creation, update, cancellation, and reminder messages. When building a reminder template, you can layout the message once and then assign a notifier to use that template for all future messages.
Summary Templates
Summary templates customize the output from a daily, weekly, or rolling Event Summary. When creating a summary template, the message layout you specify is repeated for each event in the target time frame.
The Summary Style selected at the top of the template editor determines the organization of the summary. The Group By Day style organizes sets of events by their start time day, adds a day title, and then repeats your layout under that title. The Single Events style organizes the events chronologically and then lets you define a title and content section applied to each event.
Due to the complexity of summary templates, we've included a preview section at the bottom of the template editor, which shows approximately how your message will appear in Discord.
Standard Event Data Fields
The following list the standard event data fields retrieved from your connected external calendar. Some of these fields may be blank if your external calendar doesn't support them.
Field | Type | Description |
---|---|---|
.Title | string | Event Title |
.Description | string | Event Description |
.StartTime | datetime | Timestamp of when the event is set to begin |
.Endtime | datetime | Timestamp of when the event is set to end |
.LastUpdate | datetime | Timestamp of when the event was last edited in the external calendar |
.Location | string | Location of the event as specified in the external calendar event's Location field (if available) |
.EventCalendarLink | url | URL to the event in the external calendar (if available) |
.ConferenceLink | url | URL to the event's virtual conference link (if available) |
.CalendarName | string | Name of the external calendar where this event resides |
.Status | string | Current status of the event (e.g. "active" or "cancelled") |
Generated Data Fields
Generated data fields are not retrieved from your external calendars, but are instead derived data. These are a combination of notifier settings and bot status fields generated while processing your events.
Field | Type | Description |
---|---|---|
.EventLink | url | Primary event URL determined by searching all available options and using the notifier's Event Link setting |
.DiscordEventLink | url | URL to the associated Discord Event (if it exists) |
.ForumPostLink | url | URL to the associated Discord Forum Thread (if Notifier is creating forum posts) |
.Duration | string | Duration of the event (e.g. "30 minutes" or "2 hours") |
.Mentions | string | All role mentions in Discord's formatting |
.MessageReason | string | Reason for why this message is being sent |
.MessageReasonIcon | url | URL of the icon associated with the reason this message is being sent |
.StartingInText | string | Static text of when this event will begin (e.g. "Starting in 45 minutes") |
Front Matter Data Fields
Front matter data fields are a one-to-one mapping of the Event Front Matter keys which can be set inside of an event's description.
Field | Type | Description |
---|---|---|
.Frontmatter.Cover | url | URL of the png or jpg image to be used as the cover of the Discord Event |
.Frontmatter.Thumbnail | string | URL of the thumbnail image to be used in the reminder message |
.Frontmatter.EmbedImage | url | URL of the image to be used in the reminder message |
.Frontmatter.EventLocation | string | Location to be used for the Discord Event |
.Frontmatter.Location | string | Location override to the event's location |
.Frontmatter.LocationFromDescription | url | URL pulled from the event's description (if enabled) |
.Frontmatter.ReminderLink | url | URL to be used in reminder messages |
.Frontmatter.SummaryLink | url | URL to be used in summary messages |
.Frontmatter.Tags | string | Tags set for filtering |
Template Functions
Template functions are helpers who can take the data field(s) you provide, process them, and produce an output. Functions need to be surrounded by double curly braces, like data fields, followed by their parameters. For example, a template function exampleFunction
, which takes two parameters, would be written as:
{{exampleFunction param1 param2}}
The table below explains each of these functions and their parameters and provides an example of usage.
Functions | ||||
---|---|---|---|---|
discordDateTime datetime format
The Example Usage: {{discordDateTime .StartTime "F"}} | ||||
fixedWidthText text length
The Example Usage: `{{fixedWidthText .Title 40}}` | ||||
locationFormatted The Example Usage: {{locationFormatted}} | ||||
minutesUntil datetime
The Example Usage:
| ||||
spacer The Example Usage: {{spacer}} | ||||
truncate text length
The Example Usage: {{truncate .Description 120}} | ||||
timeRange The Example Usage: {{timeRange}} |