pixelart / swiftmailer-manipulator-bundle
Manipulates outgoing mails from Swiftmailer
Requires
- php: ^5.4 || ^7.0
- symfony/framework-bundle: ^2.7 || ^3.0
- symfony/swiftmailer-bundle: ^2.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^1.12
- matthiasnoback/symfony-config-test: ^2.0
- phpunit/phpunit: ^4.8 || ^5.6
- symfony/phpunit-bridge: ^2.7 || ^3.0
This package is auto-updated.
Last update: 2024-11-14 22:18:22 UTC
README
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.