mirror of
https://github.com/quentin-g-dev/afup.git
synced 2026-03-25 17:52:13 +01:00
27 lines
682 B
PHP
27 lines
682 B
PHP
<?php
|
|
|
|
namespace Afup\Site\Utils;
|
|
|
|
use AppBundle\Email\Mailer\Mailer;
|
|
use AppBundle\Email\Mailer\Adapter\PhpMailerAdapter;
|
|
use Psr\Log\NullLogger;
|
|
use Twig\Loader\FilesystemLoader;
|
|
use Twig_Environment;
|
|
|
|
class Mail
|
|
{
|
|
const PROJECT_DIR = __DIR__.'/../../..';
|
|
|
|
public static function createMailer()
|
|
{
|
|
$configuration = new Configuration(self::PROJECT_DIR.'/configs/application/config.php');
|
|
|
|
return new Mailer(
|
|
new NullLogger(),
|
|
new Twig_Environment(new FilesystemLoader(self::PROJECT_DIR.'/app/Resources/views/')),
|
|
PhpMailerAdapter::createFromConfiguration($configuration),
|
|
$configuration
|
|
);
|
|
}
|
|
}
|