mirror of
https://github.com/mgerb/tmail
synced 2026-01-10 17:42:48 +00:00
init
This commit is contained in:
22
mail/mail.go
Normal file
22
mail/mail.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package mail
|
||||
|
||||
import (
|
||||
"github.com/mgerb/tmail/db"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type Mail struct {
|
||||
ID int `storm:"increment" json:"id"`
|
||||
From string `json:"from"`
|
||||
To string `storm:"index" json:"to"`
|
||||
Subject string `json:"subject"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
func (m *Mail) Save() {
|
||||
err := db.Conn.Save(m)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user