Add function to send a notification mail

This commit is contained in:
kolaente 2021-02-07 16:40:43 +01:00
parent 9d0bc9adf0
commit 8d3b9cd237
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 13 additions and 0 deletions

View File

@ -16,6 +16,8 @@
package notifications
import "code.vikunja.io/api/pkg/mail"
type Mail struct {
from string
to string
@ -69,3 +71,14 @@ func (m *Mail) Line(line string) *Mail {
return m
}
func SendMail(m *Mail) error {
opts, err := RenderMail(m)
if err != nil {
return err
}
mail.SendMail(opts)
return nil
}