forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhermes_mailer.go
More file actions
31 lines (27 loc) · 751 Bytes
/
Copy pathhermes_mailer.go
File metadata and controls
31 lines (27 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package emails
import (
"fmt"
"strconv"
"time"
"github.com/go-hermes/hermes/v2"
)
// HermesGeneratorConfig contains details for the generator
type HermesGeneratorConfig struct {
AppURL string
AppName string
AppLogoURL string
}
// Generator creates hermes.Hermes from HermesGeneratorConfig
func (config *HermesGeneratorConfig) Generator() hermes.Hermes {
return hermes.Hermes{
Theme: newHermesTheme(),
Product: hermes.Product{
// Appears in header & footer of e-mails
Name: fmt.Sprintf("The %s Team", config.AppName),
Link: config.AppURL,
// Optional product logo
Copyright: fmt.Sprintf("© %s %s. All rights reserved.", strconv.Itoa(time.Now().Year()), config.AppName),
Logo: config.AppLogoURL,
},
}
}