Skip to content

Commit

Permalink
Merge pull request #44 from dachcom-digital/p11
Browse files Browse the repository at this point in the history
Pimcore 11 Support
  • Loading branch information
solverat authored Aug 30, 2023
2 parents e1dff08 + 2e3a979 commit 7032a7d
Show file tree
Hide file tree
Showing 57 changed files with 307 additions and 461 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://test:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -38,12 +38,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
PIMCORE_CODECEPTION_VERSION: "2.0"
PIMCORE_CODECEPTION_VERSION: "3.0"

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ php-cgi.core
/tests/_output/*
/tests/_data/*
!/tests/_data/.gitkeep
/tests/_support/_generated/*
/tests/Support/_generated/*
12 changes: 6 additions & 6 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
| Q | A
| ---------------- | -----
| Bug report? | yes/no
| Feature request? | yes/no
| BC Break report? | yes/no
| RFC? | yes/no
| Q | A |
|------------------|--------|
| Bug report? | yes/no |
| Feature request? | yes/no |
| BC Break report? | yes/no |
| RFC? | yes/no |

<!--
- Please fill in this template according to your issue.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# License
Copyright (C) 2017 DACHCOM.DIGITAL
Copyright (C) 2023 DACHCOM.DIGITAL

This software is available under the GNU General Public License version 3 (GPLv3).

Expand Down
14 changes: 7 additions & 7 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
| Q | A
| ------------- | ---
| Bug fix? | yes/no
| New feature? | yes/no
| BC breaks? | no
| Deprecations? | yes/no
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| Q | A |
|---------------|----------------------------------------------------|
| Bug fix? | yes/no |
| New feature? | yes/no |
| BC breaks? | no |
| Deprecations? | yes/no |
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> |

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,32 @@
[![PhpStan](https://img.shields.io/github/actions/workflow/status/dachcom-digital/pimcore-dynamic-search/.github/workflows/php-stan.yml?branch=master&style=flat-square&logo=github&label=phpstan%20level%204)](https://github.com/dachcom-digital/pimcore-emailizr/actions?query=workflow%3A%22PHP%20Stan%22)

### Requirements
* Pimcore >= 10.1.0
* PHP >= 8.0
* Pimcore: ^11.0
* PHP: >= 8.1

### Release Plan

| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------|------------|
| **2.x** | `10.1` - `10.6` | `^5.4` | 21.09.2021 | Feature Branch | dev-master |
| **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 06.12.2017 | No | 1.x |
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------|---------------------------------------------------------------------|
| **3.x** | `11.0` | `^6.2` | -- | Feature Branch | master |
| **2.x** | `10.1` - `10.6` | `^5.4` | 21.09.2021 | Maintained | [2.x](https://github.com/dachcom-digital/pimcore-emailizr/tree/2.x) |
| **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 06.12.2017 | No | [1.x](https://github.com/dachcom-digital/pimcore-emailizr/tree/1.x) |

## Installation

```json
"require" : {
"dachcom-digital/emailizr" : "~2.0.0",
"dachcom-digital/emailizr" : "~3.0.0",
}
```

Add Bundle to `bundles.php`:
```php
return [
EmailizrBundle\EmailizrBundle::class => ['all' => true],
];
```

- Create valid email markup with inky and inline styles.
- Respect editables in pimcore edit mode.

Expand All @@ -38,7 +46,7 @@ Just extend the emailizr layout:
This will include a markup like this. You may want to change it:
```twig
{% apply spaceless %}
{{ emailizr_style_collector.add('@EmailizrBundle/Resources/public/css/foundation-for-emails/foundation.min.css') }}
{{ emailizr_style_collector.add('@EmailizrBundle/public/css/foundation-for-emails/foundation.min.css') }}
{% emailizr_inline_style %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand All @@ -53,7 +61,7 @@ This will include a markup like this. You may want to change it:
</style>
{% endblock %}
</head>
{% emailizr_inky %}
{% apply inky_to_html %}
<body>
{% block body %}
<table class="body">
Expand All @@ -70,7 +78,7 @@ This will include a markup like this. You may want to change it:
<div style="display:none; white-space:nowrap; font:15px courier; line-height:0;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
{% endblock %}
</body>
{% end_emailizr_inky %}
{% endapply %}
</html>
{% end_emailizr_inline_style %}
{% endapply %}
Expand Down
25 changes: 10 additions & 15 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# Upgrade Notes
--

## Version 2.0.3
- Allow `pelago/emogrifier:^7.0`
- Bump `lorenzo/pinky` to `1.0.9`

## Version 2.0.2
- Allow Pimcore 11
- Fix parsing of variables in links (`<a href="{{ variable }}">link</a>`)

## Version 2.0.1
- [ENHANCEMENT] PHP 8.1 compatibility [@scrummer](https://github.com/dachcom-digital/pimcore-emailizr/pull/35)

## Migrating from Version 1.x to Version 2.0.0
- Pimcore X support only
- PHP 8.0 support only
## Migrating from Version 2.x to Version 3.0.0
- Pimcore 11.0 support only
- PHP >= 8.1 support only
- [NEW FEATURE][BC BREAK] We're now using the symfony [inky parser](https://twig.symfony.com/doc/2.x/filters/inky_to_html.html) instead of `lorenzo/pinky` (which will be used by twig, but we want to stick with Symfony's recommended stack).
- replace `{% emailizr_inky %}` with `{% apply inky_to_html %}`
- replace `{% end_emailizr_inky %}` with `{% endapply %}`
- [BC BREAK] `@Emailizr/layout.html.twig` is using inky markup by default
- [BC BREAK] Include path `@EmailizrBundle/Resources/public/[...]` changed to `@EmailizrBundle/public/[...]`. Please change your includes accordingly

***

Emailizr 1.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-emailizr/blob/1.x/UPGRADE.md
Emailizr 2.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-emailizr/blob/2.x/UPGRADE.md
9 changes: 5 additions & 4 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
namespace: DachcomBundle\Test
support_namespace: Support
actor: Tester
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
output: tests/_output
log: tests/_output/var/logs
data: tests/_data
support: tests/Support
bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
memory_limit: -1
colors: true
params:
Expand Down
15 changes: 6 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"autoload": {
"psr-4": {
"EmailizrBundle\\": "src/EmailizrBundle"
"EmailizrBundle\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -28,19 +28,16 @@
"bundles": [
"EmailizrBundle\\EmailizrBundle"
]
},
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"require": {
"pimcore/pimcore": "^10.1 || ^11.0",
"lorenzo/pinky": "^1.0.9",
"pelago/emogrifier": "^4.0 | ^5.0 | ^6.0 | ^7.0"
"pimcore/pimcore": "^11.0",
"twig/inky-extra": "^3.0",
"pelago/emogrifier": "^7.0"
},
"require-dev": {
"codeception/codeception": "^4.1",
"codeception/module-symfony": "^1.6",
"codeception/codeception": "^5.0",
"codeception/module-symfony": "^3.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"symplify/easy-coding-standard": "^9.0"
Expand Down
2 changes: 2 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: services/*.yaml }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ services:
autoconfigure: true
public: false

EmailizrBundle\Twig\Extension\InkyExtension:
tags:
- { name: twig.extension }

EmailizrBundle\Twig\Extension\InlineStyleExtension:
tags:
- { name: twig.extension }
12 changes: 6 additions & 6 deletions docs/10_FormBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Get FormBuilder [here](https://github.com/dachcom-digital/pimcore-formbuilder).

```twig
{% apply spaceless %}
{{ emailizr_style_collector.add('@YourBundle/Resources/public/css/style.css') }}
{{ emailizr_style_collector.add('@YourBundle/public/css/style.css') }}
{% emailizr_inline_style %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand All @@ -24,7 +24,7 @@ Get FormBuilder [here](https://github.com/dachcom-digital/pimcore-formbuilder).
</style>
{% endblock %}
</head>
{% emailizr_inky %}
{% apply inky_to_html %}
{% if editmode %}
Expand Down Expand Up @@ -63,7 +63,7 @@ Get FormBuilder [here](https://github.com/dachcom-digital/pimcore-formbuilder).
</container>
{% endif %}
{% end_emailizr_inky %}
{% endapply %}
</html>
{% end_emailizr_inline_style %}
{% endapply %}
Expand All @@ -75,11 +75,11 @@ Get FormBuilder [here](https://github.com/dachcom-digital/pimcore-formbuilder).
```twig
{% apply spaceless %}
{{ emailizr_style_collector.add('@YourBundle/Resources/public/css/style.css') }}
{{ emailizr_style_collector.add('@YourBundle/public/css/style.css') }}
{% emailizr_inline_style %}
{% emailizr_inky %}
{% apply inky_to_html %}
<container>
Expand All @@ -105,7 +105,7 @@ Get FormBuilder [here](https://github.com/dachcom-digital/pimcore-formbuilder).
{% endfor %}
</container>
{% end_emailizr_inky %}
{% endapply %}
{% end_emailizr_inline_style %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function add(string $file): void
$this->cssFiles[] = $file;
}

public function removeAll()
public function removeAll(): void
{
$this->cssFiles = [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class EmailizrExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../Resources/config']));
$loader->load('services.yml');
$loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../../config']));
$loader->load('services.yaml');
}
}
14 changes: 5 additions & 9 deletions src/EmailizrBundle/EmailizrBundle.php → src/EmailizrBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@

use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class EmailizrBundle extends AbstractPimcoreBundle
{
use PackageVersionTrait;

const PACKAGE_NAME = 'dachcom-digital/emailizr';
public const PACKAGE_NAME = 'dachcom-digital/emailizr';

public function build(ContainerBuilder $container)
protected function getComposerPackageName(): string
{
parent::build($container);
return self::PACKAGE_NAME;
}

/**
* {@inheritdoc}
*/
protected function getComposerPackageName(): string
public function getPath(): string
{
return self::PACKAGE_NAME;
return \dirname(__DIR__);
}
}
2 changes: 0 additions & 2 deletions src/EmailizrBundle/Resources/config/services.yml

This file was deleted.

Loading

0 comments on commit 7032a7d

Please sign in to comment.