https://github.com/friendsofshopware/froshtemplatemail
This plugin allows you to use Smarty in your template mails
https://github.com/friendsofshopware/froshtemplatemail
Last synced: about 1 month ago
JSON representation
This plugin allows you to use Smarty in your template mails
- Host: GitHub
- URL: https://github.com/friendsofshopware/froshtemplatemail
- Owner: FriendsOfShopware
- License: mit
- Created: 2018-03-03T15:35:22.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2023-02-25T14:41:27.000Z (about 2 years ago)
- Last Synced: 2024-04-24T18:26:06.337Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 72.3 KB
- Stars: 32
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Store Shopware mail templates in theme
[](https://gitter.im/FriendsOfShopware/Lobby)
[](https://store.shopware.com/frosh46026077660f/froshtemplatemail.html)This plugin allows to store the mails in theme instead of database. This gives us advantages like
* easier deployment
* translate it using snippets
* build your mail template using includes / extends / blocks / inheritance
* usage of theme configuration## Requirements
- Shopware 5.4.x or higher
- PHP 7.0## Installation
- Download latest release
- Extract the zip file in `shopware_folder/custom/plugins/`## Template location
Create a mail for a specific subshop or language shop (also inheritance in shops works)
Search order in example with sOrder:
#### HTML Template
* `themes/Frontend/MyTheme/email/sORDER-SHOPID.html.tpl` (Shop ID)
* `themes/Frontend/MyTheme/email/sORDER.html.tpl` (Default)
* Database saved values#### Text Template:
* `themes/Frontend/MyTheme/email/sORDER-SHOPID.text.tpl` (Shop ID)
* `themes/Frontend/MyTheme/email/sORDER.text.tpl` (Default)
* Database saved values#### Subject Template:
* `themes/Frontend/MyTheme/email/sORDER-SHOPID.subject.tpl` (Shop ID)
* `themes/Frontend/MyTheme/email/sORDER.subject.tpl` (Default)
* Database saved values## Loaders
### Available loaders
* [MJML](https://github.com/FriendsOfShopware/FroshTemplateMailMjml)
### Write your own loader
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
twig = $twig;
}public function canHandleExtensions(): array
{
return ['twig'];
}
public function loadMail(Mail $mail, string $templatePath, string $resolvedTemplatePath): string
{
return $this->twig->render($resolvedTemplatePath);
}
}
``````xml
```
## Contributing
Feel free to fork and send pull requests!
## Licence
This project uses the [MIT License](LICENCE.md).