Added basic email renderer

This commit is contained in:
2019-08-16 14:27:45 +09:00
parent 373b34177d
commit 2a1d4ea479
9 changed files with 90 additions and 25 deletions

View File

@ -208,6 +208,17 @@ func (user *User) SendNotification(pushNotification *PushNotification) {
// Save changes
subs.Save()
// Send email notification
if IsDevelopment() && user.ID == "4J6qpK1ve" {
subject := notification.Title
html := HTMLEmailRenderer.Notification(notification)
err := SendEmail(user.Email, subject, html)
if err != nil {
fmt.Println(err)
}
}
// Send an event to the user's open tabs
user.BroadcastEvent(&aero.Event{
Name: "notificationCount",