Skip to content

petrabarus/yii2-archivable-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-archivable-mailer

Yii2 extension for archiving mail HTML content

Latest Stable Version Total Downloads Latest Unstable Version

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist petrabarus/yii2-archivable-mailer "*"

or add

"petrabarus/yii2-archivable-mailer": "*"

to the require section of your composer.json file.

Usage

At the moment there is only one provider: AWS S3. Put the behavior in the mailer configuration.

    'mailer' => [
        /* @var $mailer yii\swiftmailer\Mailer */
        'viewPath' => '@app/mail',
        'useFileTransport' => true,
        'as archivable' => [
            'class' => '\PetraBarus\Yii2\ArchivableMailer\ArchivableBehavior',
            'provider' => [
                'class' => '\PetraBarus\Yii2\ArchivableMailer\Providers\S3Provider',
                'bucket' => 'bucket',
                'directoryPath' => 'email',
                'config' => [
                    'key' => 'AKIAI123456789012345',
                    'secret' => '1234567890123456789012345678901234567890',
                    'region' => 'ap-southeast-1',
                ]
            ]
        ]
    ],

To put the URL of the archive in the HTML, just put {{archiveurl}} in the HTML.

e.g.

   <a href="{{archiveurl}}">View in Browser</a>

The text can be changed using archiveUrlTag attribute of the behavior.

Road Map

  • Add more providers.

About

Yii2 extension for archiving mail HTML content

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages