You can download the github version. How to install
Or using composer : composer require zaeder/link4mailing-bundle
1 - Add bundle to app/AppKernel.php
How to configure<?php
2 - Add your user entity class to app/config/config.yml
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;
}
[...]
}zaeder_link4mailing:
user_class: MyBundle\Entity\User
Call to the service method : Generate a link
$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)