blob: f41e1ff65f70e0f82ca239e4ed0106e762c00804 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package main
import (
"github.com/Masterminds/sprig"
"os"
"text/template"
)
func WithdrawMotion(decision *Decision, voter *Voter) (err error) {
// load template, fill name, tag, title, content
type mailContext struct {
*Decision
Name string
Sender string
Recipient string
}
context := mailContext{decision, voter.Name, config.NoticeSenderAddress, config.BoardMailAddress}
// fill withdraw_mail.txt
t, err := template.New("withdraw_mail.txt").Funcs(
sprig.GenericFuncMap()).ParseFiles("templates/withdraw_mail.txt")
if err != nil {
logger.Fatal(err)
}
// TODO: send mail
t.Execute(os.Stdout, context)
// TODO: implement call decision.Close()
return
}
|