diff --git a/config/config.go b/config/config.go index c284627..afd0c89 100644 --- a/config/config.go +++ b/config/config.go @@ -46,6 +46,7 @@ type Config struct { SmtpUseAuth bool // Set whether to use authentication on the smarthosthost SmtpIdentity string // Smarthost username SmtpPassword string // Smarthost password + SupportMail string // separate mail address for support contact } SQL struct { Type string // Can be "SQLite" or "Mysql" @@ -143,6 +144,15 @@ func validateConfig(conf *Config) error { err = fmt.Errorf("Validating config: Mail FromName could not be parsed (%w)", mailFromNameErr) log.Println(err) } + supportMail, mailSupportMailErr := mail.ParseAddress(string(conf.Mailer.SupportMail)) + if !(mailSupportMailErr == nil) { + err = fmt.Errorf("Validating config: SupportMail could not be parsed (%w)", mailSupportMailErr) + log.Println(err) + } + if !(supportMail.Name == "") { + err = fmt.Errorf("Validating config: SupportMail must not contain a name") + log.Println(err) + } if !(conf.SQL.Type == "SQLite" || conf.SQL.Type == "Mysql") { err = fmt.Errorf("Validating config: SQL type must be 'SQLite' or 'Mysql', but is '%s'.", conf.SQL.Type) log.Println(err.Error()) diff --git a/config/config.json b/config/config.json index 2e78982..78ff627 100644 --- a/config/config.json +++ b/config/config.json @@ -28,7 +28,8 @@ "smtpPort": 25, "smtpUseAuth": false, "smtpIdentity": "", - "smtpPassword": "" + "smtpPassword": "", + "supportMail": "officeHoursSupport@localhost" }, "SQL": { "type": "SQLite", diff --git a/templating/templates/addFailure.html b/templating/templates/addFailure.html index 8ca8fd9..07b10c1 100644 --- a/templating/templates/addFailure.html +++ b/templating/templates/addFailure.html @@ -2,7 +2,7 @@ {{define "content"}}
- Irgendetwas ist schief gegangen. Bitte sende folgende Daten an sprechstundentool@mathebau.de mit einer Beschreibung, was du tun wolltest. + Irgendetwas ist schief gegangen. Bitte sende folgende Daten an {{.Config.Mailer.SupportMail}} mit einer Beschreibung, was du tun wolltest.
{{.}}
diff --git a/templating/templates/addMask.html b/templating/templates/addMask.html index 51f74cd..e99bc10 100644 --- a/templating/templates/addMask.html +++ b/templating/templates/addMask.html @@ -50,7 +50,7 @@
Wenn du eine Veranstaltung hier vermisst, schreibe an - sprechstundentool@mathebau.de. + {{.Config.Mailer.SupportMail}}.
diff --git a/templating/templates/addSuccess.html b/templating/templates/addSuccess.html index 83182f8..be5bb2c 100644 --- a/templating/templates/addSuccess.html +++ b/templating/templates/addSuccess.html @@ -2,6 +2,11 @@ {{define "content"}}
+
+ Die Mailzustellung an Web und GMX ist gerade gestört. + Falls deine Mailadresse dorthin weiterleitet und du die Bestätigung nicht erhältst, + melde dich bei {{.Config.Mailer.SupportMail}}. +
Die Sprechstunde wurde angelegt. Du solltest eine Mail mit einem Aktivierungslink erhalten haben. Klicke auf diesen, um die Sprechstunde öffentlich anzuzeigen. diff --git a/templating/templates/base.html b/templating/templates/base.html index 6bf31d7..8c7a3e9 100644 --- a/templating/templates/base.html +++ b/templating/templates/base.html @@ -34,8 +34,7 @@
© Fachschaft Mathematik, TU Darmstadt
- - Technische Fragen an sprechstundentool@mathebau.de + Technische Fragen an {{.Config.Mailer.SupportMail}}
Quellcode und Featurewünsche: Gitea-Repository
diff --git a/templating/templates/executeFailure.html b/templating/templates/executeFailure.html index 21d68e5..2185df5 100644 --- a/templating/templates/executeFailure.html +++ b/templating/templates/executeFailure.html @@ -2,7 +2,7 @@ {{define "content"}}
- Irgendetwas ist schief gegangen. Bitte sende folgende Daten an sprechstundentool@mathebau.de mit einer Beschreibung, was du tun wolltest. + Irgendetwas ist schief gegangen. Bitte sende folgende Daten an {{.Config.Mailer.SupportMail}} mit einer Beschreibung, was du tun wolltest.
{{.}}
"