Documentation ¶
Index ¶
- Constants
- func EngineConfigFileYamlLoad(configFileYaml string, cfg *EngineConfig) (err error)
- func LoadSenderConfig(configFileYaml string, cfg *Sender) (err error)
- type Action
- type Body
- type Button
- type Columns
- type EmailData
- type Engine
- type EngineConfig
- type Entry
- type Hermes
- type Message
- type Product
- type SMTP
- type Sender
- type Table
- type Theme
- type Themes
Constants ¶
View Source
const DEFAULT_FILE_PERM os.FileMode = 0644
View Source
const DEFAULT_FOLDER_PERM os.FileMode = 0777
View Source
const THEME_HTML_FILE = "html.tmpl"
View Source
const THEME_TEXT_FILE = "text.tmpl"
View Source
const TIME_FORMAT = "2006_01_02__15_04_05_000"
Variables ¶
This section is empty.
Functions ¶
func EngineConfigFileYamlLoad ¶
func EngineConfigFileYamlLoad(configFileYaml string, cfg *EngineConfig) (err error)
func LoadSenderConfig ¶
Types ¶
type Action ¶
type Action struct { Instructions string `yaml:"instructions"` Button Button `yaml:"button"` InviteCode string `yaml:"inviteCode"` }
Action is anything the user can act on (i.e., click on a button, view an invite code)
func (*Action) ToHermesAction ¶
func (o *Action) ToHermesAction() *hermes.Action
type Body ¶
type Body struct { Name string `yaml:"name"` // The name of the contacted person Intros []string `yaml:"intros"` // Intro sentences, first displayed in the email Dictionary []Entry `yaml:"dictionary"` // A list of key+value (useful for displaying parameters/settings/personal info) Table Table `yaml:"table"` // Table is an table where you can put data (pricing grid, a bill, and so on) Actions []Action `yaml:"actions"` // Actions are a list of actions that the user will be able to execute via a button click Outros []string `yaml:"outros"` // Outro sentences, last displayed in the email Greeting string `yaml:"greeting"` // Greeting for the contacted person (default to 'Hi') Signature string `yaml:"signature"` // Signature for the contacted person (default to 'Yours truly') Title string `yaml:"title"` // Title replaces the greeting+name when set }
func (*Body) ToHermesBody ¶
func (o *Body) ToHermesBody() hermes.Body
type Button ¶
type Button struct { Color string `yaml:"color"` TextColor string `yaml:"textColor"` Text string `yaml:"text"` Link string `yaml:"link"` }
Button defines an action to launch
func (*Button) ToHermesButton ¶
func (o *Button) ToHermesButton() hermes.Button
type Columns ¶
Columns contains meta-data for the different columns
func (*Columns) ToHermesColumns ¶
func (o *Columns) ToHermesColumns() hermes.Columns
type EmailData ¶
type EmailData struct { To []string Name string Subject string Url string Markdown string Theme string }
func (*EmailData) ToAsString ¶
type Engine ¶
type Engine struct { hermes.Hermes hermes.Body Sender *encrypt.Encryptor // contains filtered or unexported fields }
func NewEngine ¶
func NewEngine(config *EngineConfig) (ret *Engine, err error)
func (*Engine) BuildEmail ¶
type EngineConfig ¶
type EngineConfig struct { EmailsFolder string `yaml:"emailsFolder", envconfig:"PATH_EMAILS"` StoreEmails bool `yaml:"storeEmails", envconfig:"STORE_EMAILS"` Hermes Hermes `yaml:"hermes"` Sender Sender `yaml:"sender"` }
func EngineCinfigDefault ¶
func EngineCinfigDefault() (ret *EngineConfig)
func (*EngineConfig) Setup ¶
func (o *EngineConfig) Setup() (err error)
func (*EngineConfig) WriteFileYaml ¶
func (o *EngineConfig) WriteFileYaml(configFileYaml string) (err error)
func (*EngineConfig) WriteSenderConfig ¶
func (o *EngineConfig) WriteSenderConfig(configFileYaml string) (err error)
type Entry ¶
Entry is a simple entry of a map Allows using a slice of entries instead of a map Because Golang maps are not ordered
func (*Entry) ToHermesEntry ¶
func (o *Entry) ToHermesEntry() hermes.Entry
type Hermes ¶
type Product ¶
type Product struct { Name string `yaml:"name", envconfig:"PRODUCT_NAME"` Link string `yaml:"link", envconfig:"PRODUCT_LINK"` Logo string `yaml:"logo", envconfig:"PRODUCT_LOGO"` Copyright string `yaml:"copyright", envconfig:"PRODUCT_COPYRIGHT"` TroubleText string `yaml:"troubleText", envconfig:"PRODUCT_TROUBLE_TEXT"` }
func (*Product) ToHermesProduct ¶
func (o *Product) ToHermesProduct() hermes.Product
type Sender ¶
type Table ¶
type Table struct { Data [][]Entry `yaml:"data"` // Contains data Columns Columns `yaml:"columns"` // Contains meta-data for display purpose (width, alignement) }
Table is an table where you can put data (pricing grid, a bill, and so on)
func (*Table) ToHermesTable ¶
func (o *Table) ToHermesTable() *hermes.Table
type Theme ¶
type Theme struct {
// contains filtered or unexported fields
}
func (*Theme) HTMLTemplate ¶
func (*Theme) PlainTextTemplate ¶
Click to show internal directories.
Click to hide internal directories.