finish backend of custom emails
biggest bodge i've ever done but it works i guess.
This commit is contained in:
@@ -120,14 +120,18 @@ func (ls *setupLangs) getOptions() [][2]string {
|
||||
type langSection map[string]string
|
||||
type tmpl map[string]string
|
||||
|
||||
func (el langSection) template(field string, vals tmpl) string {
|
||||
text := el.get(field)
|
||||
func templateString(text string, vals tmpl) string {
|
||||
for key, val := range vals {
|
||||
text = strings.ReplaceAll(text, "{"+key+"}", val)
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
func (el langSection) template(field string, vals tmpl) string {
|
||||
text := el.get(field)
|
||||
return templateString(text, vals)
|
||||
}
|
||||
|
||||
func (el langSection) format(field string, vals ...string) string {
|
||||
text := el.get(field)
|
||||
for _, val := range vals {
|
||||
|
||||
Reference in New Issue
Block a user