pagemachine / typo3-mail-css-inliner
CSS inliner for the TYPO3 mailer
Installs: 31 084
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 6
Forks: 2
Open Issues: 6
Type:typo3-cms-extension
Requires
- php: ^8.0
- symfony/mailer: ^5.4 || ^6.4 || ^7.0
- symfony/mime: ^5.4 || ^6.4 || ^7.0
- tijsverkoyen/css-to-inline-styles: ^2.2
- typo3/cms-core: ^11.5 || ^12.4
Requires (Dev)
- ergebnis/composer-normalize: ^2.8
- friendsofphp/php-cs-fixer: ^3.45
- http-interop/http-factory-guzzle: ^1.2
- jangregor/phpstan-prophecy: ^1.0.0
- php-http/curl-client: ^2.1
- php-parallel-lint/php-console-highlighter: ^1.0.0
- php-parallel-lint/php-parallel-lint: ^1.2
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^9.0
- rpkamp/mailhog-client: ^2.0.0
- typo3/coding-standards: ^0.7.1
- typo3/testing-framework: ^7.0
Replaces
- typo3-ter/mail-css-inliner: 3.1.2
This package is auto-updated.
Last update: 2024-12-09 11:13:11 UTC
README
This extension integrates a CSS inliner into the TYPO3 core mailer.
Installation
This extension is installable from various sources:
-
Via Composer:
composer require pagemachine/typo3-mail-css-inliner
-
From the TYPO3 Extension Repository
After installing the extension registers itself automatically, no further configuration is necessary.
Purpose
Designing mails is hard. Especially requirements like table layouts and inline styles are complicated to handle and take a lot of time to get right. This extension takes one burden off your shoulders and takes care of turning a regular stylesheet to inline styles. See our blog post about Mail styling in TYPO3 now easier.
Before:
<!doctype html> <html> <head> <title>CSS Inline Test</title> <style> body { color: #333; } h1 { font-size: 36px; } a { color: #337ab7; } </style> </head> <body> <h1>Headline</h1> <p>Content with <a href="https://example.org">link</a>.</p> </body> </html>
After:
<html> <head> <title>CSS Inline Test</title> <style> body { color: #333; } h1 { font-size: 36px; } a { color: #337ab7; } </style> </head> <body style="color: #333;"> <h1 style="font-size: 36px;">Headline</h1> <p>Content with <a href="https://example.org" style="color: #337ab7;" target="_blank">link</a>.</p> </body> </html>
Currently only <style>
elements are supported, external styles via <link>
are not imported.
Testing
All tests can be executed with the shipped Docker Compose definition:
docker compose run --rm app composer build