Admin_EmailController::sendTestEmailAction PHP Method

sendTestEmailAction() public method

* global functionalities
public sendTestEmailAction ( )
    public function sendTestEmailAction()
    {
        if (!$this->getUser()->isAllowed("emails")) {
            throw new \Exception("Permission denied, user needs 'emails' permission.");
        }
        $mail = new Mail();
        $mail->addTo($this->getParam("to"));
        $mail->setSubject($this->getParam("subject"));
        $mail->setIgnoreDebugMode(true);
        if ($this->getParam("type") == "text") {
            $mail->setBodyText($this->getParam("content"));
        } else {
            $mail->setBodyHtml($this->getParam("content"));
        }
        $mail->send();
        $this->_helper->json(["success" => true]);
    }