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
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
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)