The core function of Paperboy is to deliver content to recipients. Each campaign is stored as file with a configuration header that’s commonly known as front matter.
To body of the campaign builds on the combination of Markdown markup language with the templating support from Go standard libraries. These are simple yet powerful pieces that allow multi-format emails with customized per-recipient content.
Organization
The campaign files go under the content
directory of your project,
nested at any level.
.
└── content
└── announcements
| └── upcoming-keynote.md
└── newsletters
├── 2017-03-01.md
└── 2017-04-01.md
The full name of the campaign is the path within the content
directory
without the extension - you will use this to deliver campaigns:
paperboy send announcements/upcoming-keynote ...
Custom content with text/template
After separating it from the front matter, Paperboy will
process the template body with Go’s text/template
library,
and then render the Markdown template into HTML and text formats.
The following variables are available in the template scope of your campaign:
Variable | Description |
---|---|
.Recipient.Email |
Destination email for recipient |
.Recipient.Params |
Other metadata from recipient list |
.Campaign.Subject |
Campaign subject from front matter |
.Campaign.From |
Campaign sender from front matter |
.Address |
Physical address from your configuration |
.UnsubscribeURL |
Unsubscribe link from your configuration |
These variables can be inserted into the body of your campaign, and be part of simple logic operations.
Format content with Markdown
Blackfriday is Paperboy’s Markdown rendering engine. Markdown use is out of the scope of this documentation. You can learn about these by visiting the corresponding websites.
Supported formats
At this time, we only support Markdown-formatted templates.
Example
---
from: "Paperboy Team <team@paperboy.email>"
subject: "Hello from \"Paperboy\""
---
Hello {{ .Recipient.Name }},
Come to https://paperboy.email to check out this new cool campaign engine!
Cheers!