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.
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.
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.
# 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: '[email protected]' # The address message should be sent from
second_mailer:
# ...
The contributing guidelines contains all the information about contributing to the bundle.
We use GitHub issues and waffle.io board to track issues. If you have found bug, please create an issue.
License can be found here.
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code.