Skip to content

Commit

Permalink
FEATURE: Support for Neos 4 / Flow 5
Browse files Browse the repository at this point in the history
  • Loading branch information
skurfuerst committed Nov 4, 2019
1 parent e59d168 commit 5e7427e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Classes/Domain/Service/EmailService.php
Expand Up @@ -7,7 +7,7 @@
use Neos\Flow\Log\Utility\LogEnvironment;
use Neos\FluidAdaptor\View\StandaloneView;
use Neos\SwiftMailer\Message;
use Pelago\Emogrifier;
use Pelago\Emogrifier\CssInliner;
use Psr\Log\LoggerInterface;
use Sandstorm\TemplateMailer\Exception;

Expand Down Expand Up @@ -161,8 +161,7 @@ public function renderEmailBody(string $templateName, string $templatePackage, s
// Emogrify - this will inline any styles in the HTML for proper display in Gmail.
$emogrifiedFormats = ['htm', 'html'];
if ($emogrify && in_array($format, $emogrifiedFormats)) {
$emogrifier = new Emogrifier($emailBody);
$emailBody = $emogrifier->emogrify();
$emailBody = CssInliner::fromHtml($html)->inlineCss()->render();
}

return $emailBody;
Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -7,10 +7,12 @@ This package works in Neos CMS and Flow and provides the following functionality
* Automatic inlining of CSS into the email body, making it look good in clients like Gmail as well

## Compatibility and Maintenance
Sandstorm.TemplateMailer is currently being maintained for Neos 3.x / Flow 4.x.
Sandstorm.TemplateMailer is currently being maintained for the following versions:

| Neos / Flow Version | Sandstorm.TemplateMailer Version | Maintained |
|----------------------------|----------------------------------|------------|
| Neos 5.x, Flow 6.x | 2.x | Yes |
| Neos 4.x, Flow 5.x | 1.x | Yes |
| Neos 3.x, Flow 4.x | 1.x | Yes |

# Configuration and Usage
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -19,7 +19,7 @@
"require": {
"neos/flow": "^6.0",
"neos/swiftmailer": "^7.0",
"pelago/emogrifier": "^2.0"
"pelago/emogrifier": "^3.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 5e7427e

Please sign in to comment.