feat(emailApi): formatting
Build and Push Docker image / build-and-push (push) Successful in 2m7s
Details
Build and Push Docker image / build-and-push (push) Successful in 2m7s
Details
This commit is contained in:
parent
98c55bc5ae
commit
1af5c40832
|
@ -28,6 +28,9 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re
|
|||
recipientEmail := recipient.GetString("email")
|
||||
senderEmail := sender.GetString("email")
|
||||
|
||||
// get email subject
|
||||
subject := "[StuVe IT] " + emailRecord.GetString("subject")
|
||||
|
||||
// render email template
|
||||
html, err := registry.LoadFiles(
|
||||
"html/blankEmail.html",
|
||||
|
@ -37,6 +40,7 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re
|
|||
"SENDER_GIVENNAME": sender.GetString("givenName"),
|
||||
"SENDER_EMAIL": senderEmail,
|
||||
"CONTENT": safeContent,
|
||||
"SUBJECT": subject,
|
||||
})
|
||||
if err != nil {
|
||||
currentErrors := emailRecord.GetString("errors")
|
||||
|
@ -45,9 +49,6 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re
|
|||
return
|
||||
}
|
||||
|
||||
// get email subject
|
||||
subject := emailRecord.GetString("subject")
|
||||
|
||||
// set reply-to header
|
||||
headers := make(map[string]string)
|
||||
headers["Reply-To"] = senderEmail
|
||||
|
@ -59,7 +60,7 @@ func sendEmailToUser(app *pocketbase.PocketBase, registry *template.Registry, re
|
|||
Name: app.Settings().Meta.SenderName,
|
||||
},
|
||||
To: []mail.Address{{Address: recipientEmail}},
|
||||
Subject: "[StuVe IT] " + subject,
|
||||
Subject: subject,
|
||||
HTML: html,
|
||||
Headers: headers,
|
||||
}
|
||||
|
|
|
@ -48,15 +48,18 @@
|
|||
<div class="stack">
|
||||
<div class="container">
|
||||
<h1 class="blue-text">You got mail 📩</h1>
|
||||
<p>Du hast eine E-Mail von {{.SENDER_GIVENNAME}} {{.SENDER_SN}} ({{.SENDER_EMAIL}})</p>
|
||||
<p>
|
||||
Du hast eine E-Mail von {{.SENDER_GIVENNAME}} {{.SENDER_SN}} (<a href="mailto:{{.SENDER_EMAIL}}">{{.SENDER_EMAIL}}</a>)
|
||||
</p>
|
||||
</div>
|
||||
<div class="container">
|
||||
{{.CONTENT|raw}}
|
||||
</div>
|
||||
<div class="container">
|
||||
<p>Du kannst {{.SENDER_GIVENNAME}} {{.SENDER_SN}} antworten, indem du auf den untenstehenden Button klickst.</p>
|
||||
<p>Du kannst {{.SENDER_GIVENNAME}} {{.SENDER_SN}} antworten, indem du auf den untenstehenden Button klickst:</p>
|
||||
<br/>
|
||||
<a class="action-btn" href="mailto:{{.SENDER_EMAIL}}?subject=Re: {{.SUBJECT}}">↩ Antworten</a>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="group">
|
||||
|
|
Loading…
Reference in New Issue