From 073fa466d678d366117dbea83f2a02aab0f0d7a0 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 16 Sep 2023 22:12:19 +1000 Subject: [PATCH] Added mail:list --- app/Console/Commands/MailList.php | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 app/Console/Commands/MailList.php diff --git a/app/Console/Commands/MailList.php b/app/Console/Commands/MailList.php new file mode 100644 index 0000000..46cba6d --- /dev/null +++ b/app/Console/Commands/MailList.php @@ -0,0 +1,73 @@ +argument('ftn')); + + $this->info('Netmail'); + $this->table([ + 'id' => 'ID', + 'msgid' => 'MSGID', + 'from' => 'FROM', + 'to' => 'TO', + 'subject' => 'SUBJECT', + ],$ao->netmailWaiting()->map(function($item) { + return [ + 'id'=>$item->id, + 'msgid'=>$item->msgid, + 'from'=>$item->from, + 'to'=>$item->to, + 'subject'=>$item->subject, + ]; + })); + + $this->info('Echomail'); + $this->table([ + 'id' => 'ID', + 'msgid' => 'MSGID', + 'from' => 'FROM', + 'to' => 'TO', + 'subject' => 'SUBJECT', + 'area' => 'AREA', + ],$ao->echomailWaiting()->map(function($item) { + return [ + 'id'=>$item->id, + 'msgid'=>$item->msgid, + 'from'=>$item->from, + 'to'=>$item->to, + 'subject'=>$item->subject, + 'area'=>$item->echoarea->name, + ]; + })); + + return Command::SUCCESS; + } +} \ No newline at end of file