<commit_before><?php

namespace Cac\MailingBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;
use Hip\MandrillBundle\Message;
use Hip\MandrillBundle\Dispatcher;
/**
 * Mailing controller.
 *
 * @Route("/mailing")
 */
class DefaultController extends Controller
{
    /**
     * @Route("/test")
     * @Template()
     */
    public function indexAction()
    {
        $dispatcher = $this->get('hip_mandrill.dispatcher');

        $message = new Message();
        $templateName = 'test-template';

        $message
            ->addTo('<EMAIL>', 'Jonathan')
            ->setSubject('Validation')
            ->setText('Merci de valider votre inscription')
            ->setTrackOpens(true)
            ->setTrackClicks(true);

        $result = $dispatcher->send($message, $templateName);

        return new Response('<pre>' . print_r($result, true) . '</pre>');<commit_msg>Last test working, let's go on Mandrill !<commit_after><?php

namespace Cac\MailingBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;
use Hip\MandrillBundle\Message;
use Hip\MandrillBundle\Dispatcher;
/**
 * Mailing controller.
 *
 * @Route("/mailing")
 */
class DefaultController extends Controller
{
    /**
     * @Route("/test")
     * @Template()
     */
    public function indexAction()
    {
        $dispatcher = $this->get('hip_mandrill.dispatcher');

        $message = new Message();
        $templateName = 'user-validation';
        $link = 'http://www.click-and-cheers.com/';
        $templateContent = array(
            array(
                'name' => 'link',
                'content' => '<a href="'.$link.'">'.$link.'</a>'
            )
        );

        $message
            ->addTo('<EMAIL>', '<NAME>')
            ->setSubject('Test template')
            ->setTrackOpens(true)
            ->setTrackClicks(true);

        $result = $dispatcher->send($message, $templateName, $templateContent);

        return new Response('<pre>' . print_r($result, true) . '</pre>');
{'fraction_non_alphanumeric': 0.1505922165820643, 'fraction_numerical': 0.0, 'mean_word_length': 2.877049180327869, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1082813', 'n_tokens_mistral': 689, 'n_tokens_neox': 667, 'n_words': 121}