GitHub - foundation/inky-example-go: Example: Using Inky email framework with go

A minimal example showing how to use the Inky email framework from Go via the Go bindings.

Requires Inky v2. See installation instructions.

Prerequisites

  • Go >= 1.21
  • The libinky shared library (build from source: cargo build -p inky-ffi --release)

Quick Start

File Structure

src/emails/welcome.inky    Source template
data/welcome.json           Sample merge data
dist/                       Built output (generated)
cmd/build/main.go           Build command
cmd/send/main.go            Email sending example

Building

go run cmd/build/main.go transforms the Inky template, generates a merged version with sample data, and creates a plain text version.

Sending

Edit cmd/send/main.go with your SMTP credentials, then:

Uses Go's built-in net/smtp. See comments for ESP alternatives.

Documentation