|
@ -125,15 +125,14 @@ func (s *Service) Register(oldService types.Service, client *gomatrix.Client) er |
|
|
// validate that we have at least a plain text template
|
|
|
// validate that we have at least a plain text template
|
|
|
if templates.TextTemplate == "" { |
|
|
if templates.TextTemplate == "" { |
|
|
return fmt.Errorf("plain text template missing") |
|
|
return fmt.Errorf("plain text template missing") |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
// validate the plain text template is valid
|
|
|
// validate the plain text template is valid
|
|
|
_, err := text.New("textTemplate").Parse(templates.TextTemplate) |
|
|
_, err := text.New("textTemplate").Parse(templates.TextTemplate) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.WithError(err).Print("plain text template error") |
|
|
log.WithError(err).Print("plain text template error") |
|
|
return fmt.Errorf("plain text template is invalid") |
|
|
return fmt.Errorf("plain text template is invalid") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
if templates.HTMLTemplate != "" { |
|
|
if templates.HTMLTemplate != "" { |
|
|
// validate that the html template is valid
|
|
|
// validate that the html template is valid
|
|
|
_, err := html.New("htmlTemplate").Parse(templates.HTMLTemplate) |
|
|
_, err := html.New("htmlTemplate").Parse(templates.HTMLTemplate) |
|
|