diff options
| author | Bobby <[email protected]> | 2025-12-23 10:55:56 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-12-23 10:55:56 +0530 |
| commit | 078a60e33af6e6013fe7b86643180e7d13aa63d0 (patch) | |
| tree | 32d9e90e9305e947dc20a7a04023205430522bbc /controllers/mail.go | |
| parent | 318360a60aa52cf91ac80d547285f4d14c2c4517 (diff) | |
| download | lain-078a60e33af6e6013fe7b86643180e7d13aa63d0.tar.xz lain-078a60e33af6e6013fe7b86643180e7d13aa63d0.zip | |
email utils and functions
Diffstat (limited to 'controllers/mail.go')
| -rw-r--r-- | controllers/mail.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/controllers/mail.go b/controllers/mail.go index 2d32936..da2adf2 100644 --- a/controllers/mail.go +++ b/controllers/mail.go @@ -1 +1,35 @@ package controllers + +import ( + "lain/repository" + "lain/session" + "lain/utils/meta" + "lain/utils/shortcuts" + + "github.com/gofiber/fiber/v2" +) + +func Mailbox(context *fiber.Ctx) error { + folderPath := context.Params("*", "inbox") + if folderPath == "" { + folderPath = "inbox" + } + + email, err := session.GetSessionEmail(context) + if err != nil { + return InternalServerError(context, err) + } + + folders := repository.GetFolders(email, folderPath) + displayName := repository.GetFolderDisplayName(email, folderPath) + + emails := []fiber.Map{} + + meta.SetPageTitle(context, displayName) + + return shortcuts.Render(context, "mail/folder", fiber.Map{ + "Folders": folders, + "Emails": emails, + "Email": nil, + }) +} |
