# Class: EmailController

# EmailController

The Email controller.

# Public Instance Methods

### inbox_list ()

List contents of the user‘s Inbox

Show source...

         # File bbs/lib/controllers/email.rb, line 103
    103:   def inbox_list
    104:     inbox =  Tgtemplate::Template.parse_dataset($db[:email].filter(:user_id => $session.user_id).all)
    105:     Tgtemplate.display('email_list_inbox.ftl', {'emails' => inbox})
    106:   end

### menu ()

Email main menu handler

Show source...

        # File bbs/lib/controllers/email.rb, line 58
    58:   def menu
    59:     done = false
    60:     validkeys=['A','C','I','O','S','X']
    61:     until done == true
    62:       unread = Tgemail.filter(:user_id => $session.user_id).count
    63:       key = Tgio::Input.menuprompt('menu_email.ftl',validkeys, {"unread" => unread.to_s}) # tgni = TG Not Implemented
    64:       print "\n"
    65:       case key
    66:         when "A" # List archived mail
    67:           Telegard.unimplemented
    68:         when "C" # Compose new mail
    69:           Telegard.unimplemented
    70:         when "I" # Inbox navigator
    71:           self.navigator('inbox')
    72:         when "O" # List Outbox
    73:           Telegard.unimplemented
    74:         when "S" # Search Email
    75:           Telegard.unimplemented
    76:         when "X" # Return to main
    77:           done = true
    78:           return 0
    79:       end #/case
    80:     end #/until
    81:   end

### navigator (folder)

Email Navigator - a generic interface to reading email messages. Function takes a "folder" name

Show source...

         # File bbs/lib/controllers/email.rb, line 84
     84:   def navigator(folder)
     85:     done = false
     86:     validkeys=['A','D','F','H','L','R','V','X', '?']
     87:     until done == true
     88:       unread = Tgemail.filter(:user_id => $session.user_id).count
     89:       key = Tgio::Input.menuprompt('menu_email_inbox.ftl',validkeys, {"unread" => unread.to_s}) # tgni = TG Not Implemented
     90:       print "\n"
     91:       case key
     92:         when "A" # Archive
     93:         when "L" # List Inbox
     94:           self.inbox_list
     95:         when "X" # Return to email menu
     96:           done = true
     97:           return 0
     98:       end #/case
     99:     end #/until
    100:   end

### read_msg ()

Interactive Message Reader

Show source...

         # File bbs/lib/controllers/email.rb, line 109
    109:   def read_msg
    110:
    111:   end