{"id":13828597,"url":"https://github.com/FriendsOfShopware/FroshTemplateMail","last_synced_at":"2025-07-09T06:32:16.864Z","repository":{"id":47540787,"uuid":"123704986","full_name":"FriendsOfShopware/FroshTemplateMail","owner":"FriendsOfShopware","description":"This plugin allows you to use Smarty in your template mails","archived":false,"fork":false,"pushed_at":"2023-02-25T14:41:27.000Z","size":74,"stargazers_count":32,"open_issues_count":1,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-24T18:26:06.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FriendsOfShopware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-03T15:35:22.000Z","updated_at":"2024-04-23T13:22:39.000Z","dependencies_parsed_at":"2024-01-28T01:05:07.733Z","dependency_job_id":"242383dc-488b-40c5-8e8b-1a6577deadfa","html_url":"https://github.com/FriendsOfShopware/FroshTemplateMail","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2FFroshTemplateMail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2FFroshTemplateMail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2FFroshTemplateMail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2FFroshTemplateMail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendsOfShopware","download_url":"https://codeload.github.com/FriendsOfShopware/FroshTemplateMail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492420,"owners_count":17482869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:02:54.281Z","updated_at":"2024-11-20T08:30:50.451Z","avatar_url":"https://github.com/FriendsOfShopware.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Store Shopware mail templates in theme\n\n[![Join the chat at https://gitter.im/FriendsOfShopware/Lobby](https://badges.gitter.im/FriendsOfShopware/Lobby.svg)](https://gitter.im/FriendsOfShopware/Lobby)\n[![Download @ Community Store](https://api.friendsofshopware.com/v2/shopware/badge/FroshTemplateMail)](https://store.shopware.com/frosh46026077660f/froshtemplatemail.html)\n\nThis plugin allows to store the mails in theme instead of database. This gives us advantages like\n\n* easier deployment\n* translate it using snippets\n* build your mail template using includes / extends / blocks / inheritance\n* usage of theme configuration\n\n\n## Requirements\n\n- Shopware 5.4.x or higher\n- PHP 7.0\n\n\n## Installation\n\n- Download latest release\n- Extract the zip file in `shopware_folder/custom/plugins/`\n\n\n## Template location\n\nCreate a mail for a specific subshop or language shop (also inheritance in shops works)\n\nSearch order in example with sOrder:\n\n#### HTML Template\n  * `themes/Frontend/MyTheme/email/sORDER-SHOPID.html.tpl` (Shop ID)\n  * `themes/Frontend/MyTheme/email/sORDER.html.tpl` (Default)\n  * Database saved values\n\n#### Text Template:\n  * `themes/Frontend/MyTheme/email/sORDER-SHOPID.text.tpl` (Shop ID)\n  * `themes/Frontend/MyTheme/email/sORDER.text.tpl` (Default)\n  * Database saved values\n\n#### Subject Template:\n  * `themes/Frontend/MyTheme/email/sORDER-SHOPID.subject.tpl` (Shop ID)\n  * `themes/Frontend/MyTheme/email/sORDER.subject.tpl` (Default)\n  * Database saved values\n\n## Loaders\n\n### Available loaders\n\n* [MJML](https://github.com/FriendsOfShopware/FroshTemplateMailMjml)\n\n\n### Write your own loader\n\nYou 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`.\n\n**Example**\n\n```php\n\u003c?php\nnamespace MyPlugin;\n\nuse FroshTemplateMail\\Components\\Loader\\MailLoaderInterface;\nuse Shopware\\Models\\Mail\\Mail;\n\nclass TwigMailLoader implements MailLoaderInterface {\n    \n    private $twig;\n    \n    public function __construct(\\Twig_Enviroment $twig)\n    {\n        $this-\u003etwig = $twig;\n    }\n\n    public function canHandleExtensions(): array\n    {\n        return ['twig'];\n    }\n    \n    public function loadMail(Mail $mail, string $templatePath, string $resolvedTemplatePath): string\n    {\n        return $this-\u003etwig-\u003erender($resolvedTemplatePath);\n    }\n}\n```\n\n```xml\n\u003cservice id=\"my_plugin.twig_loader\" class=\"MyPlugin\\TwigMailLoader\"\u003e\n    \u003cargument type=\"service\" id=\"twig\"/\u003e\n    \u003ctag name=\"frosh_template_mail.loader\"/\u003e\n\u003c/service\u003e\n```\n\n\n## Contributing\n\nFeel free to fork and send pull requests!\n\n\n## Licence\n\nThis project uses the [MIT License](LICENCE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFriendsOfShopware%2FFroshTemplateMail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFriendsOfShopware%2FFroshTemplateMail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFriendsOfShopware%2FFroshTemplateMail/lists"}