feat(emailApi): adjusted email template
Build and Push Docker image / build-and-push (push) Successful in 3m49s
Details
Build and Push Docker image / build-and-push (push) Successful in 3m49s
Details
This commit is contained in:
parent
beea0ca329
commit
95a8b447cf
|
@ -25,10 +25,11 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re
|
||||||
html, err := registry.LoadFiles(
|
html, err := registry.LoadFiles(
|
||||||
"html/blankEmail.html",
|
"html/blankEmail.html",
|
||||||
).Render(map[string]any{
|
).Render(map[string]any{
|
||||||
"APP_URL": app.Settings().Meta.AppUrl,
|
"APP_URL": app.Settings().Meta.AppUrl,
|
||||||
"SENDER": sender.Username(),
|
"SENDER_SN": sender.GetString("sn"),
|
||||||
"SENDER_EMAIL": senderEmail,
|
"SENDER_GIVENNAME": sender.GetString("givenName"),
|
||||||
"CONTENT": emailRecord.GetString("content"),
|
"SENDER_EMAIL": senderEmail,
|
||||||
|
"CONTENT": emailRecord.GetString("content"),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
currentErrors := emailRecord.GetString("errors")
|
currentErrors := emailRecord.GetString("errors")
|
||||||
|
@ -50,6 +51,7 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re
|
||||||
To: []mail.Address{{Address: recipientEmail}},
|
To: []mail.Address{{Address: recipientEmail}},
|
||||||
Subject: "[StuVe IT] " + subject,
|
Subject: "[StuVe IT] " + subject,
|
||||||
HTML: html,
|
HTML: html,
|
||||||
|
Headers: headers,
|
||||||
}
|
}
|
||||||
if err := app.NewMailClient().Send(email); err != nil {
|
if err := app.NewMailClient().Send(email); err != nil {
|
||||||
currentErrors := emailRecord.GetString("errors")
|
currentErrors := emailRecord.GetString("errors")
|
||||||
|
@ -81,7 +83,7 @@ func sendEmails(app *pocketbase.PocketBase, emailRecord *models.Record) {
|
||||||
// InitEmailApi initializes the email notifier
|
// InitEmailApi initializes the email notifier
|
||||||
//
|
//
|
||||||
// the function sends an email notification after it was created
|
// 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")
|
logger.LogInfoF("Adding email notifier")
|
||||||
|
|
||||||
|
|
|
@ -47,18 +47,20 @@
|
||||||
</style>
|
</style>
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1 class="blue-text">Hallo 👋,</h1>
|
<h1 class="blue-text">You got mail 📩!</h1>
|
||||||
<p>Du hast eine neue Nachricht von {{.SENDER_NAME}} ({{.SENDER_EMAIL}})</p>
|
<p>Du hast eine E-Mail von {{.SENDER_GIVENNAME}} {{.SENDER_SN}} ({{.SENDER_EMAIL}})</p>
|
||||||
<br/>
|
</div>
|
||||||
<div>
|
<div class="container">
|
||||||
<p>{{.CONTENT}}</p>
|
{{.CONTENT}}
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<div class="container">
|
||||||
|
<p>Du kannst {{.SENDER_GIVENNAME}} {{.SENDER_SN}} antworten, indem du auf den untenstehenden Button klickst.</p>
|
||||||
<br/>
|
<br/>
|
||||||
|
<a class="action-btn" href="mailto:{{.SENDER_EMAIL}}?subject=Re: {{.SUBJECT}}">↩ Antworten</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<svg class="logo" width="100%" height="100%" viewBox="0 0 100 100" version="1.1"
|
<svg class="logo" width="100%" height="100%" viewBox="0 0 100 100"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
|
Loading…
Reference in New Issue