Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend template support for backend templates #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Mail/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Magento\Store\Model\StoreManagerInterface;
use Sailthru\MageSail\Model\Template as TemplateModel;

class Template extends \Magento\Email\Model\Template
class Template extends \Magento\Email\Model\BackendTemplate
{
/**
* List of the templeta variable directives.
Expand Down Expand Up @@ -49,7 +49,7 @@ public function __construct(
\Magento\Framework\View\DesignInterface $design,
\Magento\Framework\Registry $registry,
\Magento\Store\Model\App\Emulation $appEmulation,
StoreManagerInterface $storeManager,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\View\Asset\Repository $assetRepo,
\Magento\Framework\Filesystem $filesystem,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
Expand All @@ -58,7 +58,9 @@ public function __construct(
\Magento\Framework\Filter\FilterManager $filterManager,
\Magento\Framework\UrlInterface $urlModel,
\Magento\Email\Model\Template\FilterFactory $filterFactory,
\Magento\Config\Model\Config\Structure $structure,
TemplateModel $templateModel,
\Magento\Framework\Serialize\Serializer\Json $serializer = null,
array $data = []
) {
$this->templateModel = $templateModel;
Expand All @@ -76,7 +78,9 @@ public function __construct(
$filterManager,
$urlModel,
$filterFactory,
$data
$structure,
$data,
$serializer
);
}

Expand Down Expand Up @@ -151,7 +155,7 @@ public function loadDefault($templateId)

/**
* Add variable key => value directives to templateDirectives
*
*
* @customization START
*/
$parsedVars = explode('",', $matches[1]);
Expand Down
1 change: 1 addition & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
<preference for="\Magento\Framework\Mail\Template\TransportBuilder" type="Sailthru\MageSail\Mail\TransportBuilder"/>
<preference for="\Magento\Framework\Mail\Message" type="Sailthru\MageSail\Mail\Message"/>
<preference for="\Magento\Email\Model\Template" type="Sailthru\MageSail\Mail\Template"/>
<preference for="\Magento\Email\Model\BackendTemplate" type="Sailthru\MageSail\Mail\Template"/>
<preference for="\Magento\Email\Model\Template\Filter" type="Sailthru\MageSail\Mail\Filter"/>
</config>