diff --git a/emailApi/main.go b/emailApi/main.go index 0e85b4c..c4f6f4b 100644 --- a/emailApi/main.go +++ b/emailApi/main.go @@ -25,10 +25,11 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re html, err := registry.LoadFiles( "html/blankEmail.html", ).Render(map[string]any{ - "APP_URL": app.Settings().Meta.AppUrl, - "SENDER": sender.Username(), - "SENDER_EMAIL": senderEmail, - "CONTENT": emailRecord.GetString("content"), + "APP_URL": app.Settings().Meta.AppUrl, + "SENDER_SN": sender.GetString("sn"), + "SENDER_GIVENNAME": sender.GetString("givenName"), + "SENDER_EMAIL": senderEmail, + "CONTENT": emailRecord.GetString("content"), }) if err != nil { currentErrors := emailRecord.GetString("errors") @@ -50,6 +51,7 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re To: []mail.Address{{Address: recipientEmail}}, Subject: "[StuVe IT] " + subject, HTML: html, + Headers: headers, } if err := app.NewMailClient().Send(email); err != nil { currentErrors := emailRecord.GetString("errors") @@ -81,7 +83,7 @@ func sendEmails(app *pocketbase.PocketBase, emailRecord *models.Record) { // InitEmailApi initializes the email notifier // // the function sends an email notification after it was created -func InitEmailApi(app *pocketbase.PocketBase, e *core.ServeEvent) error { +func InitEmailApi(app *pocketbase.PocketBase, _ *core.ServeEvent) error { logger.LogInfoF("Adding email notifier") diff --git a/html/blankEmail.html b/html/blankEmail.html index b2195af..f52a42b 100644 --- a/html/blankEmail.html +++ b/html/blankEmail.html @@ -47,18 +47,20 @@
-

Hallo 👋,

-

Du hast eine neue Nachricht von {{.SENDER_NAME}} ({{.SENDER_EMAIL}})

-
-
-

{{.CONTENT}}

-
-
+

You got mail 📩!

+

Du hast eine E-Mail von {{.SENDER_GIVENNAME}} {{.SENDER_SN}} ({{.SENDER_EMAIL}})

+
+
+ {{.CONTENT}} +
+
+

Du kannst {{.SENDER_GIVENNAME}} {{.SENDER_SN}} antworten, indem du auf den untenstehenden Button klickst.


+ ↩ Antworten
-