package mailer import ( "github.com/animenotifier/notify.moe/arn" gomail "gopkg.in/gomail.v2" ) // SendEmailNotification sends an e-mail notification. func SendEmailNotification(email string, notification *arn.PushNotification) error { m := gomail.NewMessage() m.SetHeader("From", arn.APIKeys.SMTP.Address) m.SetHeader("To", email) m.SetHeader("Subject", notification.Title) m.SetBody("text/html", "

"+notification.Message+"

Anime cover image

") d := gomail.NewDialer(arn.APIKeys.SMTP.Server, 587, arn.APIKeys.SMTP.Address, arn.APIKeys.SMTP.Password) // Send the email return d.DialAndSend(m) }