diff options
| author | Bobby <[email protected]> | 2026-03-08 08:11:41 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-08 08:11:41 +0530 |
| commit | b2a231280ce3265d20cdc5f317ae1bcc5eb59924 (patch) | |
| tree | 90eb1a5f5409025db47097e2e083361f8fa52555 /models | |
| parent | 662dd2069dc8590e8b54823a33726464cf10c4e7 (diff) | |
| download | dove-b2a231280ce3265d20cdc5f317ae1bcc5eb59924.tar.xz dove-b2a231280ce3265d20cdc5f317ae1bcc5eb59924.zip | |
Add webmail email management templates and storage utilities
- Implemented email listing template with read/unread and star functionality.
- Created empty state template for webmail when no emails are present.
- Developed folder navigation template for managing email folders.
- Added email preview template for displaying selected email details.
- Introduced storage utilities for managing email files, including creation, reading, moving, and deletion.
- Defined constants for storage paths and error messages related to file operations.
Diffstat (limited to 'models')
| -rw-r--r-- | models/mail/email.go | 3 | ||||
| -rw-r--r-- | models/mail/folder.go | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/models/mail/email.go b/models/mail/email.go index 4b8b55e..b0cc27e 100644 --- a/models/mail/email.go +++ b/models/mail/email.go @@ -6,6 +6,9 @@ type Email struct { gorm.Model MailboxID uint `gorm:"not null;index" json:"mailbox_id"` Mailbox Mailbox `gorm:"foreignKey:MailboxID" json:"mailbox"` + FolderID uint `gorm:"not null;index" json:"folder_id"` + Folder Folder `gorm:"foreignKey:FolderID" json:"folder"` + IsStarred bool `gorm:"default:false;index" json:"is_starred"` MessageID string `gorm:"index" json:"message_id"` Filename string `gorm:"uniqueIndex;not null" json:"filename"` FromAddress string `gorm:"not null" json:"from_address"` diff --git a/models/mail/folder.go b/models/mail/folder.go new file mode 100644 index 0000000..3c46bec --- /dev/null +++ b/models/mail/folder.go @@ -0,0 +1,13 @@ +package mail + +import "gorm.io/gorm" + +type Folder struct { + gorm.Model + Name string `gorm:"not null" json:"name"` + Slug string `gorm:"not null;index" json:"slug"` + MailboxID uint `gorm:"not null;index" json:"mailbox_id"` + Mailbox Mailbox `gorm:"foreignKey:MailboxID" json:"mailbox"` + IsSystem bool `gorm:"not null;default:false" json:"is_system"` + Position int `gorm:"not null;default:0" json:"position"` +} |
