Add function to send a notification mail
This commit is contained in:
parent
9d0bc9adf0
commit
8d3b9cd237
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue