| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This plugin allows to store the mails in theme instead of database. This gives us advantages like
Create a mail for a specific subshop or language shop (also inheritance in shops works)
Search order in example with sOrder:
You can also implement your custom loader. Create a new class and implement the interface FroshTemplateMail/Components/Loader/MailLoaderInterface and register it using tag frosh_template_mail.loader.
Example
<?php
namespace MyPlugin;
use FroshTemplateMail\Components\Loader\MailLoaderInterface;
use Shopware\Models\Mail\Mail;
class TwigMailLoader implements MailLoaderInterface {
private $twig;
public function __construct(\Twig_Enviroment $twig)
{
$this->twig = $twig;
}
public function canHandleExtensions(): array
{
return ['twig'];
}
public function loadMail(Mail $mail, string $templatePath, string $resolvedTemplatePath): string
{
return $this->twig->render($resolvedTemplatePath);
}
}<service id="my_plugin.twig_loader" class="MyPlugin\TwigMailLoader">
<argument type="service" id="twig"/>
<tag name="frosh_template_mail.loader"/>
</service>Feel free to fork and send pull requests!
This project uses the MIT License.
| Back | FazBrowse Home | New Git URL |