Mails

Content

This document explains the structure and content format for novem e-mails.

E-mails (or mails for short), like most other novem visuals follows the same hierarchical folder structure that you're used to seeing. Mails are mostly similar to Documents in that it has a primary file content where most of the information for the mail is stored.

In addition to the content file, there are also supporting files and folders containing information such as recipients, attachments, configuration etc.

Below is an illustrative example of an overall e-mail structure.

daily_email_summary      => E-mail ID
...
├── content              => Content of e-mail
...

The content file /v1/vis/mails/<id>/content expects information to be supplied in novem markdown.

Like documents, novem e-mails use the novem markdown section extensions.

Sections can be used to embed visuals and control layout in novem mail. For a full overview of the section format and common parameters, see the sections overview.

Available section types:

  • Preview — preview text for inbox list views
  • Paragraph — styled text blocks with font size, style, alignment
  • Visualisation — embed novem plots and grids
  • Callout — info, warning, error and success callout boxes
  • Author — author information blocks

The preview section provides a short preview text that will only be visible in the list view of e-mail clients. It will not render in the e-mail body.

{{ preview }}
A short preview text that will show up in the list view.
{{ /preview }}

Novem plots and grids can be embedded directly in your e-mail using the vis section.

{{ vis
  ref: /u/novem_demo/p/state_pop
  width: 100%
  align: center
  include title: false
  include caption: true
}}

See the visualisation section for full details on reference formats and options.

Sending an e-mail is fairly straightforward, simply POST sent to the status endpoint in the mail structure and all valid recipients in the recipients folder (to, cc, bcc) will receive an e-mail.

{{ preview }}
Daily summary of website visitors and key metrics.
{{ /preview }}

Good morning User,

yesterday there were 4,323 unique users who visited your webpage.

{{ vis
  ref: /u/novem_demo/p/example_visits
  width: 100%
  align: center
  include caption: true
}}

{{ para
  sz: s
  fg: gray-600
  st: i
}}
This is an automatically generated e-mail.
{{ /para }}
# create a new novem e-mail
novem -m mail_name -C

# add test@novem.io to the "to" recipient list
novem -m mail_name -w recipients/to example@novem.io

# write the content of the draft.md to the mail
cat draft1.md | novem -m mail_name

# send the e-mail
novem -m mail_name -w status sent


# shorthands
cat draft.md | novem -m mail_name --to example@novem.io -S