Templates

Custom Message Templates

  Premium Feature

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.

Example of Editing a Reminder Template

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.

Example of Editing a Summary Template

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.

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)
.ForumPostLinkurlURL to the associated Discord Forum Thread (if Notifier is creating forum posts)
.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 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
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"}}
fixedWidthText text length
textString text to be set to a fixed width
lengthInteger length of the text output

The fixedWidthText function takes a text string and returns a new string which is exactly the length specified. If the input text is too short spaces are appended. If the text is too long it is truncated. This works well with Discord's inline code block markup.

Example Usage:
`{{fixedWidthText .Title 40}}`
locationFormatted

The locationFormatted function is a helper which return the event's location as a Discord formatted string. This is especially useful if you are linking to Voice Channels and want clickable VC links for your server members.

Example Usage:
{{locationFormatted}}
minutesUntil datetime
datetimeDatetime to get minutes until

The minutesUntil function takes a datetime field and converts it into an integer equal to the number of minutes until that datetime.

Example Usage:
{{$m := minutesUntil .StartTime}}
{{if le $m 60}} Within an hour {{else}} More than an hour out {{end}}
spacer

The spacer function is a helper which outputs a clear emoji card. This is useful when trying to indent and line up multiple lines of text.

Example Usage:
{{spacer}}
truncate text length
textString text to be truncated
lengthMaximum length of the text output

The truncate function takes a text string and returns a new string is truncated to the length specified. If the text is too long a trailing ellipses is added to indicate the additional length.

Example Usage:
{{truncate .Description 120}}
timeRange

The timeRange function returns the event's start and end time range using Discord's dynamic time code. For most events this will be in the format Start - End but all day events will return the text All Day translated to your desired language.

Example Usage:
{{timeRange}}
Previous
Creating an Event Feed