Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NOTE: for local testing // DefaultLayoutDir = "../../layouts" DefaultLayoutDir = "./layouts" DefaultDestDir = "./output" DefaultDestPath = "./output/generated.html" )
Default values when not provided
View Source
const ( LayoutDirNotFound = "Layout Directory Not Found" LayoutNotFoundError = "Layout Not Found" ParseLayoutError = "Error Parsing Layout" ExecuteTemplateError = "Error Execute Template" )
Default constants
Variables ¶
View Source
var FuncMap = template.FuncMap{ "Title": strings.Title, "TrimScheme": trimScheme, "GetColor": getRandomColor, "CheckSkip": checkStringNil, }
FuncMap is the default func map that comes w/ generator
View Source
var ( Layouts = []LayoutNameEnum{ Receipt, FeatureUpdates, } )
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct { LayoutDir string LayoutName *string DestPath *string DestDir string HTML *bytes.Buffer ArgsPath *string ArgsJSON *string Args interface{} }
Generator is the base struct to generate templated email
func NewGenerator ¶
func NewGenerator(layoutDir *string, layoutName *string, destPath *string, destDir *string, argsPath *string, argsJSON *string) (g Generator)
NewGenerator creates new templated email generator
func (*Generator) GetTemplateByLayout ¶
GetTemplateByLayout reads layout and shared directory to create base template
type LayoutNameEnum ¶
type LayoutNameEnum string
LayoutNameEnum is the layout name enum type
const ( Receipt LayoutNameEnum = "receipt" FeatureUpdates LayoutNameEnum = "feature-updates" Reply LayoutNameEnum = "reply" )
Layout Names
Click to show internal directories.
Click to hide internal directories.