https://github.com/synolia/syliusmailtesterplugin
Test how your emails are rendered by sending them to your email from your Sylius admin panel.
https://github.com/synolia/syliusmailtesterplugin
sylius sylius-plugin
Last synced: 2 months ago
JSON representation
Test how your emails are rendered by sending them to your email from your Sylius admin panel.
- Host: GitHub
- URL: https://github.com/synolia/syliusmailtesterplugin
- Owner: synolia
- License: mit
- Created: 2020-01-27T08:50:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-04T15:09:43.000Z (2 months ago)
- Last Synced: 2025-04-09T23:16:42.469Z (2 months ago)
- Topics: sylius, sylius-plugin
- Language: PHP
- Homepage:
- Size: 335 KB
- Stars: 13
- Watchers: 12
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://github.com/synolia/SyliusMailTesterPlugin/blob/main/LICENSE)
[](https://github.com/synolia/SyliusMailTesterPlugin/actions/workflows/analysis.yaml)
[](https://github.com/synolia/SyliusMailTesterPlugin/actions/workflows/sylius.yaml)
[](https://packagist.org/packages/synolia/sylius-mail-tester-plugin)
[](https://packagist.org/packages/synolia/sylius-mail-tester-plugin)Mail Tester Plugin
Test how your emails are rendered by sending them to your email from your Sylius admin panel.

## Features
* See a list of all sylius emails
* Send example email one by one to your email address
* Send all example emails to your email address
* For each email, you have to select the entity to be used in the template.## Requirements
| | Version |
|:-------|:--------|
| PHP | ^8.2 |
| Sylius | ^1.12 |## Installation
1. Add the bundle and dependencies in your composer.json :
```shell script
$ composer require synolia/sylius-mail-tester-plugin
```2. Enable the plugin in your `config/bundles.php` file by add
```php
Synolia\SyliusMailTesterPlugin\SynoliaSyliusMailTesterPlugin::class => ['all' => true],
```3. Create a new file `config/routes/mailtester.yaml` with:
```yaml
synolia_mail_tester:
resource: "@SynoliaSyliusMailTesterPlugin/Resources/config/admin_routing.yaml"
prefix: '/%sylius_admin.path_name%'
```## Usage
* Log into admin panel
* Click on `Mail tester` in the Configuration section in main menu
* Enter the email address that will receive the example email template
* Select the email you would like to be sent.
* Click on `Choose subject`
* Fill empty boxes and select your entities.
* Click the Submit button.## Allow sending your custom emails
In order to be able to send a custom email with variables, you have to add a form type that will add those variables to the form.
The important part is that your Form Type must implement ResolvableFormTypeInterface in order to be discovered by our FormTypeResolver.
```php
add('order', EntityType::class, [
'class' => Order::class,
'choice_label' => 'number',
]);
}public function support(string $emailKey): bool
{
return $emailKey === self::SYLIUS_EMAIL_KEY;
}public function getCode(): string
{
return self::SYLIUS_EMAIL_KEY;
}public function getFormType(string $emailKey): ResolvableFormTypeInterface
{
return $this;
}
}
```## Development
See [How to contribute](CONTRIBUTING.md).
## License
This library is under the MIT license.
## Credits
Developed by [Synolia](https://synolia.com/).