correction url mail
This commit is contained in:
@@ -16,14 +16,12 @@
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
APP_ENV=dev
|
||||
APP_SECRET=
|
||||
APP_SECRET=06c188eb6b4fe88c6ac5e8
|
||||
APP_SHARE_DIR=var/share
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> symfony/routing ###
|
||||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||
DEFAULT_URI=http://localhost
|
||||
DEFAULT_URI=https://video.powerpme.com
|
||||
###< symfony/routing ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
|
||||
@@ -10,6 +10,7 @@ parameters:
|
||||
listmonk.base_url: '%env(LISTMONK_BASE_URL)%'
|
||||
listmonk.api_user: '%env(LISTMONK_API_USER)%'
|
||||
listmonk.token: '%env(LISTMONK_TOKEN)%'
|
||||
default.url: '%env(DEFAULT_URI)%'
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
|
||||
@@ -9,8 +9,8 @@ use Symfony\Component\Process\Exception\ProcessFailedException;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use App\Service\Frontend\ListmonkMailerService;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
|
||||
#[AsMessageHandler]
|
||||
class DownloaderVideoHandler
|
||||
@@ -19,9 +19,10 @@ class DownloaderVideoHandler
|
||||
private string $path;
|
||||
|
||||
public function __construct(
|
||||
#[Autowire('%default.url%')]
|
||||
private readonly string $defaultUrl,
|
||||
private EntityManagerInterface $entityManager,
|
||||
private KernelInterface $kernel,
|
||||
private UrlGeneratorInterface $urlGenerator,
|
||||
private readonly ListmonkMailerService $mailer,
|
||||
) {
|
||||
$this->path = $this->kernel->getProjectDir() . '/public/downloader/user/';
|
||||
@@ -67,17 +68,12 @@ class DownloaderVideoHandler
|
||||
$this->entityManager->persist($userDownloader);
|
||||
$this->entityManager->flush();
|
||||
|
||||
|
||||
$absoluteURL = $this->urlGenerator->generate(
|
||||
'app_frontend_download_user',
|
||||
['id' => $userDownloader->getId()],
|
||||
UrlGeneratorInterface::ABSOLUTE_URL
|
||||
);
|
||||
$url = $this->defaultUrl . "/download/user/" . $userDownloader->getId();
|
||||
|
||||
$this->mailer->send(
|
||||
[$user->getEmail()],
|
||||
7,
|
||||
['name'=> $user->getPseudo(), 'video'=> $userDownloader->getName(), 'date'=> $userDownloader->getDateEnd()->format('d/m/Y H:i:s'), 'url'=> $absoluteURL],
|
||||
['name'=> $user->getPseudo(), 'video'=> $userDownloader->getName(), 'date'=> $userDownloader->getDateEnd()->format('d/m/Y H:i:s'), 'url'=> $url],
|
||||
'external',
|
||||
['Content-Type' => 'application/json; charset=utf-8']
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user