default values of the engine
(h *Hermes)
| 139 | |
| 140 | // default values of the engine |
| 141 | func 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 |
no outgoing calls