Esempio n. 1
0
    public function testSendLoadedBody()
    {
        $token = $this->generateSubjectToken();
        $email = new fEmail();
        $email->setFromEmail('*****@*****.**');
        $email->addRecipient(EMAIL_ADDRESS, 'Test User');
        $email->setSubject($token . ': Testing Simple Email');
        $email->loadBody('./email/loaded_body.txt', array('$PLACEHOLDER$' => 'placeholder', '%PERCENT_SIGNS%' => 'percent signs', 'nothing' => 'anything'));
        $message_id = $email->send();
        $message = $this->findMessage($token);
        $this->assertEquals($message_id, $message['headers']['Message-ID']);
        $this->assertEquals('*****@*****.**', $message['headers']['From']);
        $this->assertEquals($token . ': Testing Simple Email', $message['headers']['Subject']);
        $this->assertEquals('This is a loaded body
With a couple of different placeholder styles, including dollar signs and percent signs

You can replace anything', $message['plain']);
    }