Developed with love by KnpLabs Hire us for your project!
0

swiftmailer-manipulator-bundle

by pixelart

Manipulates outgoing mails from Swiftmailer

Swiftmailer Manipulator for Symfony

Build Status
Scrutinizer Code Quality
Code Coverage
Code Style

Sometimes you have staging systems, where you can't install MailHog and
using delivery_address or disable_delivery on the SwiftmailerBundle is
not enough. For example your customer wants the mail to be really delivered.

But maybe the crafted mail goes to a partner, retailer, user, whatever and now
they are worried why they got them (for example notification systems).

This bundle can help you! It provides a plugin into Swiftmailer, which allows
you to modify the subject or body or the from address of every message before
delivery.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

$ composer require pixelart/swiftmailer-manipulator-bundle ^1.0

This command requires you to have Composer installed globally, as explained
in the installation chapter of the Composer
documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Pixelart\Bundle\SwiftmailerManipulatorBundle\PixelartSwiftmailerManipulatorBundle(),
        );

        // ...
    }

    // ...
}

For more informations, see the configuration page.

Full configuration options

# app/config/config.yml

pixelart_swiftmailer_manipulator:
    mailers:
        first_mailer:
            prepend_subject: 'String prepend to subject'  # String which is prepended onto the subject
            prepend_body: 'path/to/prepend_body.txt.twig' # Path to template which is prepended onto the mail body
            from_address: 'altered-form@example.com'      # The address message should be sent from
        second_mailer:
            # ...

Contributing

The contributing guidelines contains all the information
about contributing to the bundle.

Bug tracking

We use GitHub issues
and waffle.io board
to track issues. If you have found bug, please create an issue.

MIT License

License can be found here.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct.
By participating, you are expected to uphold this code.

MIT License

Copyright (c) 2016 pixelart GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
pixelart_swiftmailer_manipulator:
mailers:

# Prototype
name:

# String which is prepended onto the subject
prepend_subject: ~

# Path to template which is prepended onto the mail body
prepend_body: ~

# The address message should be sent from
from_address: ~