feat(mail): one layout for all mails with logo, greeting, cards and footer
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m1s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m1s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df06ab10c8
commit
46e1137f18
16 files changed
+475
-60
No files matched your search
@@ -577,10 +577,18 @@ func (s *Server) notifyAccountChange(before *domain.User, password, email bool,
|
||||
if email {
|
||||
what = append(what, "die E-Mail-Adresse deines Kontos wurde auf "+newEmail+" geändert")
|
||||
}
|
||||
body := fmt.Sprintf("Hallo %s,\n\nin MindSift %s.\n\nWarst du das nicht, setze bitte sofort dein Passwort zurück und beende alle Sitzungen in den Kontoeinstellungen, oder wende dich an die Administration.\n",
|
||||
before.DisplayName, strings.Join(what, " und "))
|
||||
c := mailContent{
|
||||
Preheader: "Änderung an deinem MindSift-Konto",
|
||||
Greeting: mailGreeting(time.Now(), before.DisplayName),
|
||||
Intro: "In MindSift " + strings.Join(what, " und ") + ".",
|
||||
Notice: "Warst du das nicht? Setze bitte sofort dein Passwort zurück und beende alle Sitzungen in den Kontoeinstellungen, oder wende dich an die Administration.",
|
||||
Footer: mailFooterAccount,
|
||||
}
|
||||
if link := s.notifyLink(); link != "" {
|
||||
c.Button = &mailButton{Label: "MindSift öffnen", URL: link}
|
||||
}
|
||||
go func() {
|
||||
_ = s.sendEmailNotification(before.Email, "MindSift: Änderung an deinem Konto", body)
|
||||
_ = s.sendMailContent(before.Email, "MindSift: Änderung an deinem Konto", c)
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -639,7 +647,13 @@ func (s *Server) handleTestUserAlarm(w http.ResponseWriter, r *http.Request) {
|
||||
if toEmail == "" {
|
||||
toEmail = user.Email
|
||||
}
|
||||
if err := s.sendEmailNotification(toEmail, "⏰ MindSift Test-Alarm", "Hallo "+user.DisplayName+",\n\ndein E-Mail-Alarmkanal in MindSift ist erfolgreich eingerichtet und einsatzbereit.\n\nViele Grüße\nDeine MindSift Instanz"); err != nil {
|
||||
if err := s.sendMailContent(toEmail, "⏰ MindSift Test-Alarm", mailContent{
|
||||
Preheader: "Dein E-Mail-Alarmkanal funktioniert",
|
||||
Greeting: mailGreeting(time.Now(), user.DisplayName),
|
||||
Intro: "Dein E-Mail-Alarmkanal in MindSift ist eingerichtet und einsatzbereit. So sehen deine Alarme aus:",
|
||||
Sections: []mailSection{{Items: []mailItem{{Title: "Beispiel: Heizung entlüften", Meta: "Fällig: heute, 18:00 Uhr · Wichtig", Tone: "warning"}}}},
|
||||
Footer: mailFooterAlarms,
|
||||
}); err != nil {
|
||||
writeError(w, http.StatusBadGateway, "E-Mail-Versand fehlgeschlagen: "+err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user