<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Notification_Templating</id>
	<title>Notification Templating - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.foji.io/index.php?action=history&amp;feed=atom&amp;title=Notification_Templating"/>
	<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Notification_Templating&amp;action=history"/>
	<updated>2026-06-13T08:11:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://docs.foji.io/index.php?title=Notification_Templating&amp;diff=677&amp;oldid=prev</id>
		<title>Chris.Hansen: Created page with &quot;Notifications sent via contact points are built using notification templates. FojiSoft’s default templates are based on the Go templating system where some fields are evaluated as text, while others are evaluated as HTML (which can affect escaping).  The default template default_template.go is a useful reference for custom templates.  Since most of the contact point fields can be templated, you can create reusable custom templates and use them in multiple contact point...&quot;</title>
		<link rel="alternate" type="text/html" href="https://docs.foji.io/index.php?title=Notification_Templating&amp;diff=677&amp;oldid=prev"/>
		<updated>2024-01-03T17:08:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Notifications sent via contact points are built using notification templates. FojiSoft’s default templates are based on the Go templating system where some fields are evaluated as text, while others are evaluated as HTML (which can affect escaping).  The default template default_template.go is a useful reference for custom templates.  Since most of the contact point fields can be templated, you can create reusable custom templates and use them in multiple contact point...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Notifications sent via contact points are built using notification templates. FojiSoft’s default templates are based on the Go templating system where some fields are evaluated as text, while others are evaluated as HTML (which can affect escaping).&lt;br /&gt;
&lt;br /&gt;
The default template default_template.go is a useful reference for custom templates.&lt;br /&gt;
&lt;br /&gt;
Since most of the contact point fields can be templated, you can create reusable custom templates and use them in multiple contact points.&lt;br /&gt;
&lt;br /&gt;
== Using templates ==&lt;br /&gt;
The following example shows how to use default templates to render an alert message in Slack. The message title contains a count of alerts that are firing or were resolved. The message body lists the alerts and their status.&lt;br /&gt;
[[File:Visualize notification templating fields.png|center|frameless|600x600px]]&lt;br /&gt;
The following example shows the use of a custom template within one of the contact point fields.&lt;br /&gt;
[[File:Visualize notification templating use in contact point.png|center|frameless|600x600px]]&lt;br /&gt;
&lt;br /&gt;
== Nested templates ==&lt;br /&gt;
You can embed templates within other templates.&lt;br /&gt;
&lt;br /&gt;
For example, you can define a template fragment using the define keyword:&amp;lt;syntaxhighlight lang=&amp;quot;handlebars&amp;quot;&amp;gt;&lt;br /&gt;
{{ define &amp;quot;mytemplate&amp;quot; }}  {{ len .Alerts.Firing }} firing. {{ len .Alerts.Resolved }} resolved.{{ end }}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You can then embed custom templates within this fragment using the template keyword. For example:&amp;lt;syntaxhighlight lang=&amp;quot;handlebars&amp;quot;&amp;gt;&lt;br /&gt;
Alert summary:{{ template &amp;quot;mytemplate&amp;quot; . }}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You can use any of the following built-in template options to embed custom templates.&lt;br /&gt;
[[File:Visualize notification templating built in.png|center|frameless|598x598px]]&lt;br /&gt;
&lt;br /&gt;
== HTML in notification templates ==&lt;br /&gt;
HTML in alerting notification templates is escaped. We do not support rendering of HTML in the resulting notification.&lt;br /&gt;
[[Category:Visualize]]&lt;/div&gt;</summary>
		<author><name>Chris.Hansen</name></author>
	</entry>
</feed>