fom / module-setup-fixtures-email
Email template adapter for the FriendsOfMagento setup-fixtures engine.
Package info
github.com/FriendsOfMagento/module-setup-fixtures-email
Type:magento2-module
pkg:composer/fom/module-setup-fixtures-email
Requires
- php: ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- fom/module-setup-fixtures: ^1.0
- magento/framework: ^103.0.7
- magento/module-email: ^101.1.7
This package is auto-updated.
Last update: 2026-08-23 20:06:58 UTC
README
Email template adapter for the FriendsOfMagento Setup Fixtures engine.
The module creates and updates rows in Magento's email_template storage using
template_code as the unique fixture identity. Template bodies and optional styles live
in sidecar files so they remain readable and reviewable.
Installation
composer require fom/module-setup-fixtures-email bin/magento module:enable Fom_SetupFixturesEmail bin/magento setup:upgrade
The module registers the email_template installer type but ships no registered fixtures.
A consumer module provides and registers its own fixture files.
Supported versions
Magento 2
Magento 2.4.4–2.4.6 and PHP 8.1 are not supported.
| Magento | PHP |
|---|---|
| 2.4.7 | 8.2, 8.3 |
| 2.4.8 | 8.3, 8.4 |
| 2.4.9 | 8.5 |
Composer uses bounded component API families. The root Magento metapackage controls the exact security patch.
Mage-OS
| Mage-OS | PHP | Magento base |
|---|---|---|
| 3.4.0 | 8.3, 8.4, 8.5 | 2.4.9 |
Mage-OS 3.4 replaces the Magento 2.4.9 framework and email component packages, so the existing direct dependency constraints support both distributions. See the Mage-OS release policy and system requirements.
Fixture format
Required JSON fields:
| Field | Value |
|---|---|
template_code |
Unique email template name, at most 150 characters |
template_subject |
Template subject, at most 200 characters |
template_type |
html or text |
Optional JSON fields:
| Field | Value |
|---|---|
template_text_file |
Body sidecar override |
template_styles_file |
CSS sidecar override |
orig_template_code |
Original Magento template code |
orig_template_variables |
JSON object mapping variable expressions to labels |
is_legacy |
Boolean legacy rendering flag |
The body is required. Without template_text_file, the loader uses the JSON basename
with .html or .txt according to template_type.
CSS is optional. Without template_styles_file, a sibling .css file is loaded when
present and otherwise remains unmanaged. An explicitly named missing CSS file fails
validation. An existing empty CSS file clears previously stored styles.
Install
fom/module-setup-fixtures-email-data
for complete HTML and text examples registered as executable fixtures.
Register fixtures
A consumer module registers JSON fixture IDs on the email installer:
<virtualType name="Fom\SetupFixturesEmail\Model\EmailTemplate\Installer\Virtual"> <arguments> <argument name="fixtureFiles" xsi:type="array"> <item name="welcome-email" xsi:type="string">Acme_Content::fixtures/email/template/welcome.json</item> </argument> </arguments> </virtualType>
Run bin/magento setup:fixtures:validate before importing, then use
bin/magento setup:fixtures:import --entity-type=email_template or
bin/magento setup:upgrade.
Email templates are global. Assigning the generated numeric template ID to a store configuration path is deliberately outside this adapter.
Hyvä
No separate fixture adapter is needed for Hyvä because Hyvä uses Magento's native
email_template persistence. Projects using a Hyvä storefront can install the optional
hyva-themes/magento2-email-module package to restore Magento email LESS styling.
License
Licensed under the Open Software License 3.0.