Go bindings for the Inky email templating engine.
Powered by the Rust inky-core engine via cgo.
You need the libinky shared library installed. Build it from the main inky repo:
cd /path/to/inky
cargo build -p inky-ffi --release
# macOS
cp target/release/libinky.dylib /usr/local/lib/
# Linux
sudo cp target/release/libinky.so /usr/local/lib/
sudo ldconfiggo get github.com/foundation/inky-gopackage main
import (
"fmt"
inky "github.com/foundation/inky-go"
)
func main() {
html := inky.Transform(`<button href="https://example.com">Click</button>`)
fmt.Println(html)
}// Transform Inky HTML into email-safe table markup.
func Transform(html string) string
// Transform with a custom column count.
func TransformWithColumns(html string, columns uint32) string
// Transform and inline CSS from <style> blocks.
func TransformInline(html string) string
// Transform with MiniJinja data merge, then inline CSS.
func TransformWithData(html, dataJSON string) string
// Transform using hybrid output mode (div + MSO ghost tables).
func TransformHybrid(html string) string
// Migrate v1 syntax to v2.
func Migrate(html string) string
// Migrate with detailed change list.
func MigrateWithDetails(html string) (*MigrationResult, error)
// Validate a template and return diagnostics.
func Validate(html string) ([]Diagnostic, error)
// Convert HTML to plain text for multipart email.
func ToPlainText(html string) string
// Run the full build pipeline (layouts, includes, data merge, framework
// SCSS, transform, CSS inlining) — identical to `inky build`.
func Build(html, basePath string, options *BuildOptions) (BuildResult, error)
// Get the engine version.
func Version() string# Make sure libinky is built and installed first
go test -v