Files
gochat/internal/model/email_template.go.txt
T
2026-06-04 15:44:48 +08:00

25 lines
1018 B
Plaintext

package model
import (
"encoding/json"
"time"
)
// EmailTemplate represents a reusable email template.
// Reference: Chatwoot enterprise EmailTemplate + P2B M11 spec
type EmailTemplate struct {
ID uint `gorm:"primaryKey" json:"id"`
AccountID uint `gorm:"not null;index" json:"account_id"`
Name string `gorm:"size:255;not null" json:"name"`
Subject string `gorm:"size:255;not null" json:"subject"`
Content string `gorm:"type:text;not null" json:"content"`
Locale string `gorm:"size:10;default:'en'" json:"locale"`
Category string `gorm:"size:100" json:"category"`
Variables json.RawMessage `gorm:"type:jsonb" json:"variables"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
Account Account `gorm:"foreignKey:AccountID" json:"account,omitempty"`
}
func (EmailTemplate) TableName() string { return "email_templates" }