source: sandbox/webservice/api/rest/mail/SendResource.php @ 6603

Revision 6603, 1.1 KB checked in by niltonneto, 12 years ago (diff)

Ticket #2507 - Corrigido problema no envio de mensagem como texto plano.

  • Property svn:executable set to *
Line 
1<?php
2
3class SendResource extends MailAdapter {
4        public function post($request){
5                // to Receive POST Params (use $this->params)
6                parent::post($request);
7
8                if($this-> isLoggedIn())
9                {
10                        // parametros recuperados conforme draft
11                        $msgForwardTo           = $this->getParam("msgForwardTo");
12                        $originalMsgID          = $this->getParam("originalMsgID");
13                        $originalUserAction     = $this->getParam("originalUserAction");
14
15                        $params['input_subject']        = $this->getParam("msgSubject");
16                        $params['input_to']                     = $this->getParam("msgTo");
17                        $params['input_cc']                     = $this->getParam("msgCcTo");
18                        $params['input_cco']            = $this->getParam("msgBccTo");
19                        $params['input_replyto']        = $this->getParam("msgReplyTo");
20                        $params['body']                         = $this->getParam("msgBody");
21                        $params['type']                         = $this->getParam("msgType") ? $this->getParam("msgType") : "plain";
22
23                        $returncode = $this->getImap()->send_mail($params);
24                        if (!$returncode || !(is_array($returncode) && $returncode['success'] == true))
25                                Errors::runException("MAIL_NOT_SENT");
26                }
27
28                $this->setResult(true);
29
30                //to Send Response (JSON RPC format)
31                return $this->getResponse();
32        }
33
34}
Note: See TracBrowser for help on using the repository browser.