You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
681 B
Go
31 lines
681 B
Go
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
|
|
}
|