templates

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSON

func FromJSON() (int, error)

FromJSON initializes the templates from the templates/templates.json file

Types

type LocalizedTemplate

type LocalizedTemplate struct {
	Language     string `json:"language"`
	TemplateName string `json:"template"`
	FromName     string `json:"fromName"`
	Subject      string `json:"subject"`
	Template     *template.Template
}

func GetTemplate

func GetTemplate(templateName, language string) (LocalizedTemplate, error)

GetTemplate returns the template matching the templateName and the language

func (LocalizedTemplate) Execute

func (td LocalizedTemplate) Execute(payload interface{}) ([]byte, error)

Execute executes the Template, filling it with the values from the payload

func (*LocalizedTemplate) UnmarshalJSON

func (td *LocalizedTemplate) UnmarshalJSON(jsonBytes []byte) error

Jump to

Keyboard shortcuts

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