public function getSwiftMessage()
    {
        $message = \Swift_Message::newInstance();

        if (true === is_array($this->getRecipient())) {
            $recipient = $this->getRecipient();
        } else {
            $recipient = [
                $this->getRecipient(),
            ];
        };

        $message
            ->setSubject($this->getSubject())
            ->setFrom(
                [
                    $this->getSender(),
                ]
            )
            ->setTo($recipient)
            ->setBody($this->getMessage());

        if (0 < count($this->getAttachments())) {
            foreach ($this->getAttachments() as $attachment) {
                $message->attach($attachment);
            }
        }

        return $message;
    }
public function getSwiftMessage()
    {
        $message = \Swift_Message::newInstance();

        if (true === is_array($this->getRecipient())) {
            $recipient = $this->getRecipient();
        } else {
            $recipient = [
                $this->getRecipient(),
            ];
        };

        $message
            ->setSubject($this->getSubject())
            ->setFrom(
                [
                    $this->getSender(),
                ]
            )
            ->setTo($recipient)
            ->setBody($this->getMessage());

        if (0 < count($this->getAttachments())) {
            foreach ($this->getAttachments() as $attachment) {
                $message->attach($attachment);
            }
        }

        return $message;
    }
public function getSwiftMessage ( ) { $ message = \ Swift_Message :: newInstance ( ) ; if ( true === is_array ( $ this -> getRecipient ( ) ) ) { $ recipient = $ this -> getRecipient ( ) ; } else { $ recipient = [ $ this -> getRecipient ( ) , ] ; } ; $ message -> setSubject ( $ this -> getSubject ( ) ) -> setFrom ( [ $ this -> getSender ( ) , ] ) -> setTo ( $ recipient ) -> setBody ( $ this -> getMessage ( ) ) ; if ( 0 < count ( $ this -> getAttachments ( ) ) ) { foreach ( $ this -> getAttachments ( ) as $ attachment ) { $ message -> attach ( $ attachment ) ; } } return $ message ; }
Get Swift Message

@return Swift_Mime_Message
Get Swift Message