Skip to content

Custom Message Templates Premium

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

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 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 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.

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.

Attributes
.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 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.

Attributes
.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 are a one-to-one mapping of the Event Front Matter keys which can be set inside of an event’s description.

Attributes
.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 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
datetime
Datetime to be converted for Discord formatting
format
Date 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
text
String text to be set to a fixed width
length
Integer 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
datetime
Datetime 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
text
String text to be truncated
length
Maximum 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}}