Documentation
¶
Overview ¶
models/mailbox.go
Index ¶
- Constants
- type DMARCMonitoring
- type Domain
- type Email
- type EmailAttachment
- type EmailMessage
- type EmailMessageStatus
- type EmailStore
- type EmailThread
- type JSONMap
- type MailStackDomain
- type MailStackDomainConfiguration
- type Mailbox
- type MailboxProvisionStatus
- type MailboxSyncState
- type MailstackReputation
- type OrphanEmail
- type Sender
Constants ¶
const ( MAILBOX_IMAP_PORT = 993 MAILBOX_IMAP_SERVER = "mail.hostedemail.com" MAILBOX_IMAP_SECURITY = enum.EmailSecurityTLS MAILBOX_SMTP_PORT = 587 MAILBOX_SMTP_SERVER = "mail.hostedemail.com" MAILBOX_SMTP_SECURITY = enum.EmailSecurityTLS MAILBOX_INBOX = "INBOX" MAILBOX_SENT = "Sent" MAILBOX_SPAM = "Spam" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DMARCMonitoring ¶ added in v0.0.3
type DMARCMonitoring struct {
ID string `gorm:"primary_key;type:uuid;default:gen_random_uuid()" json:"id"`
Tenant string `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
EmailProvider string `gorm:"column:email_provider;type:varchar(255)" json:"emailProvider"`
Domain string `gorm:"column:domain;type:varchar(255)" json:"domain"`
ReportStart time.Time `gorm:"column:report_start;type:timestamp" json:"reportStart"`
ReportEnd time.Time `gorm:"column:report_end;type:timestamp" json:"reportEnd"`
MessageCount int `gorm:"column:message_count;type:integer" json:"messageCount"`
SPFPass int `gorm:"column:spf_pass;type:integer" json:"spfPass"`
DKIMPass int `gorm:"column:dkim_pass;type:integer" json:"dkimPass"`
DMARCPass int `gorm:"column:dmarc_pass;type:integer" json:"dmarcPass"`
Data string `gorm:"type:text"`
}
func (DMARCMonitoring) TableName ¶ added in v0.0.3
func (DMARCMonitoring) TableName() string
type Domain ¶ added in v0.0.3
type Domain struct {
ID uint64 `gorm:"primary_key;autoIncrement" json:"id"`
Tenant string `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
Domain string `gorm:"column:domain;type:varchar(255);NOT NULL;uniqueIndex" json:"domain"`
Configured bool `gorm:"column:configured;type:boolean;NOT NULL;DEFAULT:false" json:"configured"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;DEFAULT:current_timestamp" json:"updatedAt"`
Active bool `gorm:"column:active;type:boolean;NOT NULL;DEFAULT:true" json:"active"`
DkimPublic string `gorm:"column:dkim_public;type:text" json:"dkimPublic"`
DkimPrivate string `gorm:"column:dkim_private;type:text" json:"dkimPrivate"`
}
type Email ¶
type Email struct {
ID string `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
MailboxID string `gorm:"column:mailbox_id;type:varchar(50);index;not null" json:"mailboxId"`
Direction enum.EmailDirection `gorm:"column:direction;type:varchar(20);index;not null" json:"direction"`
Status enum.EmailStatus `gorm:"column:status;type:varchar(20);index" json:"status"`
MessageID string `gorm:"column:message_id;uniqueIndex;type:varchar(255);not null" json:"messageId"`
ThreadID string `gorm:"column:thread_id;type:varchar(255);index" json:"threadId"`
// Core email metadata
Subject string `gorm:"column:subject;type:varchar(1000)" json:"subject"`
FromAddress string `gorm:"column:from_address;type:varchar(255);index" json:"fromAddress"`
FromName string `gorm:"column:from_name;type:varchar(255)" json:"fromName"`
FromUser string `gorm:"column:from_user;type:varchar(255)" json:"fromUser"`
FromDomain string `gorm:"column:from_domain;type:varchar(255)" json:"fromDomain"`
ReplyTo string `gorm:"column:reply_to;type:varchar(255);index" json:"replyTo"`
ToAddresses pq.StringArray `gorm:"column:to_addresses;type:text[]" json:"toAddresses"`
CcAddresses pq.StringArray `gorm:"column:cc_addresses;type:text[]" json:"ccAddresses"`
BccAddresses pq.StringArray `gorm:"column:bcc_addresses;type:text[]" json:"bccAddresses"`
TrackClicks bool `gorm:"column:track_clicks;default:false" json:"trackClicks"`
IsViewed bool `gorm:"column:isViewed;default:false" json:"isViewed"`
Folder string `gorm:"column:folder;type:varchar(100)" json:"folder"`
// Content
Body string `gorm:"column:body;type:text" json:"body"`
HasAttachment bool `gorm:"column:has_attachment;default:false" json:"hasAttachment"`
// Send Details
StatusDetail string `gorm:"column:status_detail;type:text" json:"statusDetail"` // Error message or delivery info
SendAttempts int `gorm:"column:send_attempts;default:0" json:"sendAttempts"` // Number of send attempts
// Time information
SentAt *time.Time `gorm:"column:sent_at;type:timestamp;index" json:"sentAt"`
ReceivedAt *time.Time `gorm:"column:received_at;type:timestamp;index" json:"receivedAt"`
LastAttemptAt *time.Time `gorm:"column:last_attempt_at;type:timestamp" json:"lastAttemptAt"` // When last send attempt occurred
ScheduledFor *time.Time `gorm:"column:scheduled_for;type:timestamp;index" json:"scheduledFor"` // For scheduled sends
// Standard timestamps
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
}
Email represents a raw email message stored in the database
func (*Email) AllRecipients ¶ added in v0.0.3
type EmailAttachment ¶
type EmailAttachment struct {
ID string `gorm:"type:varchar(50);primaryKey"`
Emails pq.StringArray `gorm:"type:varchar(50)[];index;not null"`
Threads pq.StringArray `gorm:"type:varchar(50)[];index;not null"`
Filename string `gorm:"type:varchar(500)"`
ContentType string `gorm:"type:varchar(255)"`
ContentID string `gorm:"type:varchar(255)"` // For inline attachments
Size int `gorm:"default:0"`
IsInline bool `gorm:"default:false"`
// Storage options
StorageService string `gorm:"type:varchar(50)"` // "s3", "azure", "local", etc.
StorageBucket string `gorm:"type:varchar(255)"` // For cloud storage
StorageKey string `gorm:"type:varchar(1000)"` // If stored in S3/blob storage
// Security and verification
ContentHash string `gorm:"type:varchar(64);index"` // SHA-256 hash of content
// Standard timestamps
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
}
EmailAttachment represents an attachment to an email
func (*EmailAttachment) BeforeCreate ¶
func (e *EmailAttachment) BeforeCreate(tx *gorm.DB) error
func (EmailAttachment) TableName ¶
func (EmailAttachment) TableName() string
TableName overrides the table name for EmailAttachment
type EmailMessage ¶ added in v0.0.3
type EmailMessage struct {
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp"`
Status EmailMessageStatus `gorm:"size:50;not null;"`
SentAt *time.Time `gorm:"column:sent_at;type:timestamp;"`
Error *string `gorm:"column:error;type:text"`
UniqueInternalIdentifier *string `gorm:"size:255;index:unique_internal_identifier"`
Tenant string `gorm:"size:255;not null;index:idx_raw_email_external_system"`
ProducerId string `gorm:"size:255;not null;"`
ProducerType string `gorm:"size:255;not null;"`
//Email message data
FromName string `gorm:"size:255;"`
From string `gorm:"size:255;"`
FromProvider string `gorm:"size:255;"`
To []string `gorm:"-"`
ToString string `gorm:"type:text;column:to"`
Cc []string `gorm:"-"`
CcString string `gorm:"type:text;column:cc"`
Bcc []string `gorm:"-"`
BccString string `gorm:"type:text;column:bcc"`
Subject string
Content string
//COS interaction event id
//deprecated
ReplyTo *string
//Values taken from providers
ProviderMessageId string `gorm:"size:255;not null;"`
ProviderThreadId string `gorm:"size:255;not null;"`
ProviderInReplyTo string `gorm:"size:255;not null;"`
ProviderReferences string `gorm:"size:255;not null;"`
}
func (*EmailMessage) AfterFind ¶ added in v0.0.3
func (e *EmailMessage) AfterFind(tx *gorm.DB) (err error)
AfterFind hook for converting strings to slices
func (*EmailMessage) BeforeSave ¶ added in v0.0.3
func (e *EmailMessage) BeforeSave(tx *gorm.DB) (err error)
BeforeSave hook for converting slices to strings
func (EmailMessage) TableName ¶ added in v0.0.3
func (EmailMessage) TableName() string
type EmailMessageStatus ¶ added in v0.0.3
type EmailMessageStatus string
const ( EmailMessageStatusScheduled EmailMessageStatus = "SCHEDULED" EmailMessageStatusSent EmailMessageStatus = "SENT" EmailMessageStatusProcessed EmailMessageStatus = "PROCESSED" EmailMessageStatusError EmailMessageStatus = "ERROR" )
type EmailStore ¶ added in v0.1.13
type EmailStore struct {
// Primary identifiers
ID string `ch:"id"`
MailboxID string `ch:"mailbox_id"`
MessageID string `ch:"message_id,pk"` // Using as primary key
ThreadID string `ch:"thread_id"`
InReplyTo string `ch:"in_reply_to"`
References []string `ch:"references,array"`
// Email metadata
Direction string `ch:"direction"` // Store as string for better compatibility
Status string `ch:"status"`
StatusDetail string `ch:"status_detail"`
Folder string `ch:"folder"`
ImapUID uint32 `ch:"imap_uid"`
// Core email content
Subject string `ch:"subject"`
CleanSubject string `ch:"clean_subject"`
FromAddress string `ch:"from_address"`
FromName string `ch:"from_name"`
FromUser string `ch:"from_user"`
FromDomain string `ch:"from_domain"`
ReplyTo string `ch:"reply_to"`
ToAddresses []string `ch:"to_addresses,array"`
CcAddresses []string `ch:"cc_addresses,array"`
BccAddresses []string `ch:"bcc_addresses,array"`
// Simplified content fields
BodyText string `ch:"body_text"`
BodyHTML string `ch:"body_html"`
BodyMarkdown string `ch:"body_markdown"`
HasAttachment bool `ch:"has_attachment"`
HasSignature bool `ch:"has_signature"`
// Engagement metrics
TrackClicks bool `ch:"track_clicks"`
// Classification
Classification string `ch:"classification"`
ClassificationReason string `ch:"classification_reason"`
// Time information - critical for ClickHouse performance
SentAt *time.Time `ch:"sent_at,nullable"`
ReceivedAt *time.Time `ch:"received_at,nullable"`
LastAttemptAt *time.Time `ch:"last_attempt_at,nullable"`
ScheduledFor *time.Time `ch:"scheduled_for,nullable"`
CreatedAt time.Time `ch:"created_at"`
UpdatedAt time.Time `ch:"updated_at"`
// Derived fields for partitioning and optimizations
Date time.Time `ch:"date"` // Used for partitioning
YearMonth uint32 `ch:"year_month,materialized:toYYYYMM(date)"`
DayOfWeek uint8 `ch:"day_of_week,materialized:toDayOfWeek(date)"`
Hour uint8 `ch:"hour,materialized:toHour(sent_at)"`
// Email size metrics
BodyTextSize uint32 `ch:"body_text_size,materialized:length(body_text)"`
BodyHTMLSize uint32 `ch:"body_html_size,materialized:length(body_html)"`
// Special ClickHouse optimization fields
ShardKey string `ch:"_shard_key,materialized:concat(toString(year_month), message_id)"`
}
EmailStore represents an email message optimized for ClickHouse storage and analytics
func (*EmailStore) AllParticipants ¶ added in v0.1.13
func (e *EmailStore) AllParticipants() []string
func (*EmailStore) AllRecipients ¶ added in v0.1.13
func (e *EmailStore) AllRecipients() []string
func (*EmailStore) BuildHeaders ¶ added in v0.1.13
func (e *EmailStore) BuildHeaders() map[string]string
BuildHeaders creates a map of headers for an outgoing email
func (EmailStore) CreateTableSQL ¶ added in v0.1.13
func (EmailStore) CreateTableSQL() string
CreateTableSQL returns the SQL statement to create the emails table
func (*EmailStore) HasRichContent ¶ added in v0.1.13
func (e *EmailStore) HasRichContent() bool
func (EmailStore) TableName ¶ added in v0.1.13
func (EmailStore) TableName() string
TableName returns the ClickHouse table name
type EmailThread ¶
type EmailThread struct {
ID string `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
MailboxID string `gorm:"column:mailbox_id;type:varchar(50);index" json:"mailboxId"`
Subject string `gorm:"column:subject;type:varchar(1000)" json:"subject"`
Summary string `gorm:"column:summary;type:varchar(1000)" json:"summary"`
Participants pq.StringArray `gorm:"column:participants;type:text[]" json:"participants"`
LastMessageID string `gorm:"column:last_message_id;type:varchar(255)" json:"lastMessageId"`
HasAttachments bool `gorm:"column:has_attachments;default:false" json:"hasAttachments"`
IsDone bool `gorm:"column:isDone;default:false" json:"isDone"`
LastMessageAt *time.Time `gorm:"column:last_message_at;type:timestamp" json:"lastMessageAt"`
FirstMessageAt *time.Time `gorm:"column:first_message_at;type:timestamp" json:"firstMessageAt"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;DEFAULT:current_timestamp" json:"updatedAt"`
}
func (*EmailThread) BeforeCreate ¶
func (e *EmailThread) BeforeCreate(*gorm.DB) error
func (EmailThread) TableName ¶
func (EmailThread) TableName() string
type JSONMap ¶
type JSONMap map[string]interface{}
JSONMap represents a JSON object that can be stored in PostgreSQL
type MailStackDomain ¶ added in v0.0.3
type MailStackDomain struct {
ID uint64 `gorm:"primary_key;autoIncrement" json:"id"`
Tenant string `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
Domain string `gorm:"column:domain;type:varchar(255);NOT NULL;uniqueIndex" json:"domain"`
Configured bool `gorm:"column:configured;type:boolean;NOT NULL;DEFAULT:false" json:"configured"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp" json:"updatedAt"`
Active bool `gorm:"column:active;type:boolean;NOT NULL;DEFAULT:true" json:"active"`
DkimPublic string `gorm:"column:dkim_public;type:text" json:"dkimPublic"`
DkimPrivate string `gorm:"column:dkim_private;type:text" json:"dkimPrivate"`
}
TODO: Deprecated, drop in favor of Domain model
func (MailStackDomain) TableName ¶ added in v0.0.3
func (MailStackDomain) TableName() string
type MailStackDomainConfiguration ¶ added in v0.0.3
type MailStackDomainConfiguration struct {
}
type Mailbox ¶
type Mailbox struct {
ID string `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
Tenant string `gorm:"column:tenant;type:varchar(255)" json:"tenant"`
UserID string `gorm:"column:user_id;type:varchar(255);index" json:"userId"`
Provider enum.EmailProvider `gorm:"column:provider;type:varchar(50);index;not null" json:"provider"`
EmailAddress string `gorm:"column:email_address;type:varchar(255);index" json:"emailAddress"`
MailboxUser string `gorm:"column:mailbox_user;type:varchar(255);index" json:"mailboxUser"`
MailboxDomain string `gorm:"column:mailbox_domain;type:varchar(255);index" json:"mailboxDomain"`
SenderID string `gorm:"column:sender_id;type:varchar(255);index" json:"senderId"`
// Common connection properties
InboundEnabled bool `gorm:"column:inbound_enabled;default:true" json:"inboundEnabled"`
OutboundEnabled bool `gorm:"column:outbound_enabled;default:true" json:"outboundEnabled"`
// Protocol-specific configurations (null for API-based providers)
ImapServer string `gorm:"column:imap_server;type:varchar(255)" json:"imapServer"`
ImapPort int `gorm:"column:imap_port" json:"imapPort"`
ImapUsername string `gorm:"column:imap_username;type:varchar(255)" json:"imapUsername"`
ImapPassword string `gorm:"column:imap_password;type:varchar(255)" json:"imapPassword"`
ImapSecurity enum.EmailSecurity `gorm:"column:imap_security;type:varchar(50)" json:"imapSecurity"`
SmtpServer string `gorm:"column:smtp_server;type:varchar(255)" json:"smtpServer"`
SmtpPort int `gorm:"column:smtp_port" json:"smtpPort"`
SmtpUsername string `gorm:"column:smtp_username;type:varchar(255)" json:"smtpUsername"`
SmtpPassword string `gorm:"column:smtp_password;type:varchar(255)" json:"smtpPassword"`
SmtpSecurity enum.EmailSecurity `gorm:"column:smtp_security;type:varchar(50)" json:"smtpSecurity"`
// OAuth specific fields (for Google, Microsoft, etc.)
OAuthClientID string `gorm:"column:oauth_client_id;type:varchar(255)" json:"oauthClientId"`
OAuthClientSecret string `gorm:"column:oauth_client_secret;type:varchar(255)" json:"oauthClientSecret"`
OAuthRefreshToken string `gorm:"column:oauth_refresh_token;type:varchar(1000)" json:"oauthRefreshToken"`
OAuthAccessToken string `gorm:"column:oauth_access_token;type:varchar(1000)" json:"oauthAccessToken"`
OAuthTokenExpiry *time.Time `gorm:"column:oauth_token_expiry;type:timestamp" json:"oauthTokenExpiry"`
OAuthScope string `gorm:"column:oauth_scope;type:varchar(500)" json:"oauthScope"`
// Email sending configuration
ReplyToAddress string `gorm:"column:reply_to_address;type:varchar(255)" json:"replyToAddress"`
// Sync configuration
SyncFolders pq.StringArray `gorm:"column:sync_folders;type:text[]" json:"syncFolders"`
// Status tracking
ConnectionStatus enum.ConnectionStatus `gorm:"column:connection_status;type:varchar(50)" json:"connectionStatus"`
LastConnectionCheck *time.Time `gorm:"column:last_connection_check;type:timestamp" json:"lastConnectionCheck"`
ErrorMessage string `gorm:"column:error_message;type:text" json:"errorMessage"`
// Send rate limits
DailySendQuota int `gorm:"column:daily_quota;default:2000" json:"dailyQuota"`
DailySendCount int `gorm:"column:daily_send_count;default:0" json:"dailySendCount"`
QuotaResetAt *time.Time `gorm:"column:quota_reset_at;type:timestamp" json:"quotaResetAt"`
// Standard timestamps
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"`
// Fields from previous mailbox model
ProvisionStatus MailboxProvisionStatus `gorm:"column:provision_status;type:varchar(255)" json:"provisionStatus"`
MinMinutesBetweenEmails int `gorm:"type:integer" json:"minMinutesBetweenEmails"`
MaxMinutesBetweenEmails int `gorm:"type:integer" json:"maxMinutesBetweenEmails"`
ConfigureAttemptAt *time.Time `gorm:"column:configure_attempt_at;type:timestamp" json:"configureAttemptAt"`
LastRampUpAt time.Time `gorm:"column:last_ramp_up_at;type:timestamp" json:"lastRampUpAt"`
RampUpRate int `gorm:"type:integer" json:"rampUpRate"`
RampUpMax int `gorm:"type:integer" json:"rampUpMax"`
RampUpCurrent int `gorm:"type:integer" json:"rampUpCurrent"`
ForwardingTo string `gorm:"column:forwarding_to;type:text" json:"forwardingTo"`
WebmailEnabled bool `gorm:"column:webmail_enabled;type:boolean" json:"webmailEnabled"`
}
Mailbox represents an email account configuration with provider-specific settings
type MailboxProvisionStatus ¶ added in v0.1.16
type MailboxProvisionStatus string
const ( MailboxStatusPendingProvisioning MailboxProvisionStatus = "PENDING_PROVISIONING" MailboxStatusProvisioned MailboxProvisionStatus = "PROVISIONED" )
type MailboxSyncState ¶
type MailboxSyncState struct {
ID string `gorm:"column:id;type:varchar(50);primaryKey"`
MailboxID string `gorm:"column:mailbox_id;type:varchar(50);index;not null"`
FolderName string `gorm:"column:folder_name;type:varchar(100);index;not null"`
LastUID uint32 `gorm:"column:last_uid;not null"`
LastSync time.Time `gorm:"column:last_sync;type:timestamp"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp"`
}
MailboxSyncState represents the synchronization state for a mailbox folder
func (*MailboxSyncState) BeforeCreate ¶ added in v0.0.3
func (m *MailboxSyncState) BeforeCreate(tx *gorm.DB) error
func (MailboxSyncState) TableName ¶
func (MailboxSyncState) TableName() string
type MailstackReputation ¶ added in v0.0.3
type MailstackReputation struct {
ID string `gorm:"primary_key;type:uuid;default:gen_random_uuid()" json:"id"`
Tenant string `gorm:"column:tenant;type:varchar(255);NOT NULL" json:"tenant"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;DEFAULT:current_timestamp" json:"createdAt"`
Domain string `gorm:"column:domain;type:varchar(255)" json:"domain"`
DomainAgePenalty int `gorm:"column:domain_age_penalty;type:integer" json:"domainAgePenalty"`
BlacklistPenaltyPct int `gorm:"column:blacklist_penalty_pct;type:integer" json:"blacklistPenaltyPct"`
BouncePenaltyPct int `gorm:"column:bounce_penalty_pct;type:integer" json:"bouncePenaltyPct"`
DMARCPenaltyPct int `gorm:"column:dmarc_penalty_pct;type:integer" json:"dmarcPenaltyPct"`
SPFPenaltyPct int `gorm:"column:spf_penalty_pct;type:integer" json:"spfPenaltyPct"`
}
func (MailstackReputation) TableName ¶ added in v0.0.3
func (MailstackReputation) TableName() string
type OrphanEmail ¶ added in v0.0.3
type OrphanEmail struct {
ID string `gorm:"column:id;type:varchar(50);primaryKey"`
MessageID string `gorm:"column:message_id;type:varchar(255);uniqueIndex"`
ReferencedBy string `gorm:"column:referenced_by;type:varchar(255)"` // Email ID that referenced this
ThreadID string `gorm:"column:thread_id;type:varchar(50);index"`
MailboxID string `gorm:"column:mailbox_id;type:varchar(50);index"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp"`
}
func (*OrphanEmail) BeforeCreate ¶ added in v0.0.3
func (m *OrphanEmail) BeforeCreate(tx *gorm.DB) error
func (OrphanEmail) TableName ¶ added in v0.0.3
func (OrphanEmail) TableName() string
type Sender ¶ added in v0.0.22
type Sender struct {
ID string `gorm:"column:id;type:varchar(50);primaryKey" json:"id"`
Tenant string `gorm:"column:tenant;type:varchar(255)" json:"tenant"`
UserID string `gorm:"column:user_id;type:varchar(255);index" json:"userId"`
DisplayName string `gorm:"column:display_name;type:varchar(255)" json:"displayName"`
SignatureHTML string `gorm:"column:signature_html;type:text" json:"signatureHtml"`
SignaturePlain string `gorm:"column:signature_plain;type:text" json:"signaturePlain"`
IsDefault bool `gorm:"column:is_default;type:boolean" json:"isDefault"`
IsActive bool `gorm:"column:is_active;type:boolean" json:"isActive"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updatedAt"`
}