Link4mailing-bundle

Generate links for mailing with auto-login or not, with expiration date or not, etc...

Download .zip Download .tar.gz View on GitHub

Welcome to Link4mailing-bundle page.This symfony2 bundle generate links for your mails. You will be able to add an expiration date and link an user to use the auto-login method. This last one works with FOSUserBundle.

How to install You can download the github version.
Or using composer : composer require zaeder/link4mailing-bundle

How to configure 1 - Add bundle to app/AppKernel.php <?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            [...],
            new Zaeder\Link4mailingBundle\ZaederLink4mailingBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
            [...]
        }

        return $bundles;
        }

        [...]
}
2 - Add your user entity class to app/config/config.yml zaeder_link4mailing:
    user_class: MyBundle\Entity\User

Generate a link Call to the service method :
$this->container->get('Link4mailing_urlhelper')->generateLink(...)

Method's arguments :
$routeNameOrUri : Set the route name ou the url (mandatory)
$routeParams : Set the array of params for the route name (optional)
$isExternalLink : Set true value to set an external link (optional)
$userId : Set an user id to make an auto-login link (optional)
$duration : Put an integer value to set how may hours the link is valid (optional)