Wraps Yii2 mailer as object.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore Initial commit. (#1) Jun 22, 2018
.travis.yml
LICENSE
README.md
build.xml
composer.json
composer.lock
phpunit.xml

README.md

yii2-mail-object

This wraps mail object that can be instantiated rather standalone.

Build Status

Usage

Create new mail object class using MailObject.

e.g.

class DummyMail extends MailObject
{
    protected function getSubject(): string
    {
        return 'Hello, World!';
    }

    protected function getContentParams(): array
    {
        return [
            'recipientName' => 'Jane Doe',
        ];
    }

    protected function getRecipient(): array
    {
        return [
            'jane.doe@example.com' => 'Jane Doe',
        ];
    }

}

Create html.php and text.php for HTML-formatted and plain text email respectively.

To send the object, simply.

$mail = new DummyMail();
$mail->send();

Testing

To run testing, execute

./vendor/bin/phing test