templateutil

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const TemplateDirsEnv = "TEMPLATES_DIR"

TemplateDirsEnv is environment key for templates directory

Variables

This section is empty.

Functions

func ParseTemplate

func ParseTemplate(files ...string) (*template.Template, error)

ParseTemplate parses a given template

func ReadFiles

func ReadFiles(dir string) ([]string, error)

ReadFiles read files from a directory

func SetDefaults

func SetDefaults(app, website, mainColor, secColor string)

SetDefaults sets defaults for email data

Types

type EmailData

type EmailData struct {
	Names          string
	AccountID      string
	Link           string
	Token          string
	Label          string
	WebsiteURL     string
	AppName        string
	AppDescription string
	PrimaryColor   string
	SecondaryColor string
	TemplateName   string
	Reason         string
}

EmailData contains data that is sent as part of email body

func DefaultEmailData

func DefaultEmailData() *EmailData

DefaultEmailData creates email data with defaults

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL