Skip to content

OpenBuildings/swiftmailer-modify

Repository files navigation

Swiftmailer Modify

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

Modify all emails before sending

Installation

Install via composer

composer require clippings/swiftmailer-modify

Usage

This will add a "[Test]" prefix in a testing environment for every message

if ($environment === 'testing') {
    $mailer->registerPLugin(new ModifyPlugin(function(Swift_Message $message) {
        $message->setSubject('[Test] '.$message->getSubject());
    }));
}

License

Copyright (c) 2015, Clippings Ltd. Developed by Ivan Kerin

Under BSD-3-Clause license, read LICENSE file.