MCPcopy
hub / github.com/matcornic/hermes / setDefaultHermesValues

Function setDefaultHermesValues

hermes.go:141–162  ·  view source on GitHub ↗

default values of the engine

(h *Hermes)

Source from the content-addressed store, hash-verified

139
140// default values of the engine
141func setDefaultHermesValues(h *Hermes) error {
142 defaultTextDirection := TDLeftToRight
143 defaultHermes := Hermes{
144 Theme: new(Default),
145 TextDirection: defaultTextDirection,
146 Product: Product{
147 Name: "Hermes",
148 Copyright: "Copyright © 2020 Hermes. All rights reserved.",
149 TroubleText: "If you’re having trouble with the button '{ACTION}', copy and paste the URL below into your web browser.",
150 },
151 }
152 // Merge the given hermes engine configuration with default one
153 // Default one overrides all zero values
154 err := mergo.Merge(h, defaultHermes)
155 if err != nil {
156 return err
157 }
158 if h.TextDirection != TDLeftToRight && h.TextDirection != TDRightToLeft {
159 h.TextDirection = defaultTextDirection
160 }
161 return nil
162}
163
164// GenerateHTML generates the email body from data to an HTML Reader
165// This is for modern email clients

Callers 3

GenerateHTMLMethod · 0.85
GeneratePlainTextMethod · 0.85
TestHermes_DefaultFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestHermes_DefaultFunction · 0.68