Skip to content

Commit

Permalink
initialize ContaoFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Apr 30, 2024
1 parent a22943a commit 62159dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Gateway/KlickTippGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Fenepedia\ContaoKlickTippGateway\Gateway;

use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\StringUtil;
use Contao\Validator;
use Fenepedia\ContaoKlickTippGateway\Config\KlickTippConfig;
Expand All @@ -24,6 +25,7 @@ class KlickTippGateway implements GatewayInterface
public const NAME = 'klicktipp';

public function __construct(
private readonly ContaoFramework $contaoFramework,
private readonly Connector $connector,
private readonly LoggerInterface $contaoGeneralLogger,
private readonly LoggerInterface $contaoErrorLogger,
Expand Down Expand Up @@ -69,6 +71,8 @@ public function sendParcel(Parcel $parcel): Receipt

private function createKlickTippConfigStamp(Parcel $parcel): KlickTippConfigStamp
{
$this->contaoFramework->initialize();

$messageConfig = $parcel->getMessageConfig();
$tokens = $parcel->getStamp(TokenCollectionStamp::class)->tokenCollection->forSimpleTokenParser();
$email = Util::recursiveReplaceTokensAndTags($messageConfig->getString('kt_email'), $tokens);
Expand Down

0 comments on commit 62159dd

Please sign in to comment.