Templates

Custom Message Templates

 

Custom message templates allow you to specify how your Discord event messages are formatted and which data fields are included.

Reminder Message Templates

The reminder message template is used for scheduled reminders, as well as notifications for newly created, updated, or cancelled events. A default template layout is typically used, but this can be customized by creating and assigning a new Reminder Template.

Example of Editing a Reminder Template

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 data. To use a data field it 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}}

Standard Event Data Fields

The following are a list of 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.

FieldTypeDescription
.TitlestringEvent Title
.DescriptionstringEvent Description
.StartTimedatetimeTimestamp of when the event is set to begin
.EndtimedatetimeTimestamp of when the event is set to end
.LastUpdatedatetimeTimestamp of when the event was last edited in the external calendar
.LocationstringLocation of the event as specified in the external calendar event's Location field (if available)
.EventCalendarLinkurlURL to the event in the external calendar (if available)
.ConferenceLinkurlURL to the event's virtual conference link (if available)
.CalendarNamestringName of the external calendar where this event resides
.StatusstringCurrent 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.

FieldTypeDescription
.EventLinkurlPrimary event URL determined by searching all available options and using the notifier's Event Link setting
.DiscordEventLinkurlURL to the associated Discord Event (if it exists)
.DurationstringDuration of the event (e.g. "30 minutes" or "2 hours")
.MentionsstringAll role mentions in Discord's formatting
.MessageReasonstringReason for why this message is being sent
.MessageReasonIconurlURL of the icon associated with the reason this message is being sent
.StartingInTextstringStatic 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.

FieldTypeDescription
.Frontmatter.CoverurlURL of the png or jpg image to be used as the cover of the Discord Event
.Frontmatter.ThumbnailstringURL of the thumbnail image to be used in the reminder message
.Frontmatter.EmbedImageurlURL of the image to be used in the reminder message
.Frontmatter.EventLocationstringLocation to be used for the Discord Event
.Frontmatter.LocationstringLocation override to the event's location
.Frontmatter.LocationFromDescriptionurlURL pulled from the event's description (if enabled)
.Frontmatter.ReminderLinkurlURL to be used in reminder messages
.Frontmatter.SummaryLinkurlURL to be used in summary messages
.Frontmatter.TagsstringTags set for filtering

Template Functions

Template functions are helpers which 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, but they are 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, their parameters, and provides an example usage.

Functions
discordDateTime datetime format
datetimeDatetime to be converted for Discord formatting
formatDate string format of the end result

The discordDateTime function takes a datetime field and converts it into one of the responsive time formats Discord supports. Check https://hammertime.cyou for examples of the available formats.

Example Usage:
{{discordDateTime .StartTime "F"}}
Previous
Event Front Matter