https://github.com/datalust/seq-app-htmlemail
Plug-in apps that act on event streams in the Seq log server
https://github.com/datalust/seq-app-htmlemail
Last synced: 3 months ago
JSON representation
Plug-in apps that act on event streams in the Seq log server
- Host: GitHub
- URL: https://github.com/datalust/seq-app-htmlemail
- Owner: datalust
- License: apache-2.0
- Created: 2014-01-28T10:36:33.000Z (over 12 years ago)
- Default Branch: dev
- Last Pushed: 2024-06-14T21:34:51.000Z (about 2 years ago)
- Last Synced: 2026-01-14T05:43:00.112Z (5 months ago)
- Language: C#
- Homepage:
- Size: 5.25 MB
- Stars: 53
- Watchers: 10
- Forks: 38
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Seq.App.EmailPlus [](https://ci.appveyor.com/project/datalust/seq-app-htmlemail) [](https://www.nuget.org/packages?q=seq-app)
[Send log events and alerts as HTML email messages](https://docs.datalust.co/docs/formatting-html-email) when they arrive at [Seq](https://datalust.co/seq).
> [!IMPORTANT]
> This app has been superseded by [`Seq.App.Mail.Smtp`](https://github.com/datalust/seq-app-mail), which supports both plain text and HTML email templating with an improved syntax and modern SMTP defaults.

## HTML email templates
The app uses [Handlebars.Net](https://github.com/rexm/Handlebars.Net) for email templating. Check out the [Handlebars Guide](https://handlebarsjs.com/guide/) for information on the Handlebars syntax.
### Event types and properties
All templates can access the following special properties:
* `$DateTimeFormat` — the date/time format string defined in the app's settings
* `$EventType` — the numeric event type assigned to the event
* `$EventUri` — a link to the event in the Seq UI (not valid for alerts)
* `$Exception` — the exception associated with the event, if any
* `$Id` — the Seq event id
* `$Instance` — the Seq server's instance name, if any
* `$Level` — the event's level as a string
* `$LocalTimestamp` — the timestamp of the event, in the server's time zone (deprecated)
* `$Message` — the event's fully-rendered message
* `$MessageTemplate` — the event's [message template](https://messagetemplates.org)
* `$Properties` — a dictionary containing all first-class event properties (see below)
* `$ServerUri` — the Seq server's base URL
* `$TimeZoneName` — the time zone name defined in the app's settings
* `$UtcTimestamp` — the timestamp of the event
The event's first-class properties do not use prefixed `$` names, so if an event carries a `RequestId` property, this is accessed in the template as `{{RequestId}}`, **not** `{{$RequestId}}`.
Notifications for Alerts can use the properties [listed in the Seq documentation](https://docs.datalust.co/docs/alert-properties).
### Built-in helper functions
The app makes the following helper functions available in templates.
| Name | Description | Example usage |
| --- | --- | --- |
| `datetime` | Format a date time, optionally specifying a time zone | `{{datetime $SliceStart 'o' 'Australia/Brisbane'}}` |
| `if_eq` | Compare two values for equality and optionally execute a specified block | `{{#if_eq $Level 'Error'}} Oops! {{/if_eq}}` |
| `pretty` | Pretty-print a value, converting arrays and objects to JSON | `{{pretty Results}}` |
| `substring` | Compute a substring given start index and optional length | `{{substring Uri 0 5}}` |
Helpers are [defined here](https://github.com/datalust/seq-app-htmlemail/blob/dev/src/Seq.App.EmailPlus/HandlebarsHelpers.cs).
## Other Seq apps
This repository originally included the following apps from Datalust, each now in their own dedicated repositories:
* **[File Archive](https://github.com/datalust/seq-app-filearchive)** - write incoming events into a set of rolling text files
* **[First of Type](https://github.com/datalust/seq-app-firstoftype)** - raise an event the first time a new event type is seen
* **[Replication](https://github.com/datalust/seq-app-replication)** - [forward incoming events](https://docs.datalust.co/docs/event-forwarding) to another Seq server
* **[Thresholds](https://github.com/datalust/seq-app-thresholds)** - raise an event if the frequency of matched events exceeds a threshold
* **[Digest Email](https://github.com/datalust/seq-app-digestemail)** - send multiple events as a single HTML email
* **[Health Check Input](https://github.com/datalust/seq-input-healthcheck)** - periodically GET an HTTP resource and write response metrics to Seq
* **[GELF Input](https://github.com/datalust/sqelf)** - ingest events GELF format over TCP or UDP
* **[JSON Archive](https://github.com/datalust/seq-app-jsonarchive)** - write incoming events into a set of rolling files, in JSON format
* **[RabbitMQ Input](https://github.com/datalust/seq-input-rabbitmq)** - ingest events from RabbitMQ
* **[Syslog Input](https://github.com/datalust/squiflog)** - ingest syslog events over UDP