func bind2Task(p *revel.Params, t *models.Task) (err error) { p.Bind(&t.Subject, "subject") p.Bind(&t.Content, "content") p.Bind(&t.Recipient, "recipient") p.Bind(&t.SendTime, "sendtime") p.Bind(&t.SendType, "sendtype") if t.SendType == "" && (t.SendType != "notice" || t.SendType != "fanout") { t.SendType = "fanout" } t.Type = "email" t.Created_At = time.Now() t.Recipient = strings.Trim(t.Recipient, ", ") return }