agrekom / customization-email-template
Customization for Magento email templates
Package info
bitbucket.org/agrekom/customization-email-template
Type:magento2-module
pkg:composer/agrekom/customization-email-template
Requires
- magento/framework: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Magento 2 module that registers the Agrekom_CustomizationEmailTemplate namespace for Agrekom's email-related
customizations.
What this module does
The module registers the component with Magento and sends the additional order email described below.
The order item customizations for transactional emails are implemented as theme template overrides, not inside this module, in:
app/design/frontend/creativestyle/theme-agrekom/Magento_Sales/templates/email/items/order/default.phtmlapp/design/frontend/creativestyle/theme-ewarsztat/Magento_Sales/templates/email/items/order/default.phtml
Both themes extend Creativestyle/theme-creativeshop, which is why the same override exists in both — there is no
shared parent template between them to put it in only once.
Order confirmation email — item rendering
The order item block in the "Items" table was extended compared to Magento's stock template:
- Product image — a small (80×80) thumbnail is rendered to the left of the product name, using a dedicated
image type
sales_email_order_itemdefined inapp/design/frontend/creativestyle/theme-creativeshop/etc/view.xml. - SKU — shown under the product name (kept from Magento core; resolves the simple product's SKU for configurable
products via
getSku()). - EAN — shown under the SKU, only when the product has a value for the
eanattribute. If the attribute is empty or not set, the line is omitted entirely.
Layout is done with an inline-styled nested <table> (image cell + details cell) rather than relying on compiled
LESS classes, since transactional emails are generated from the pre-compiled css/email.css and won't pick up new
LESS rules without a static content deploy — inline styles keep the layout correct regardless of deploy state.
Additional order email
Whenever OrderSender::send() actually sends the order confirmation, the SendAdditionalOrderEmail plugin also sends
a separate email to the configured recipients (one message per recipient, the customer never receives it). This
includes asynchronous sending and manual resends from the admin panel.
- Configuration: Stores > Configuration > Sales > Sales Emails > Order - Additional Email
(
sales_email/order_additional/enabled,sales_email/order_additional/recipients— comma-separated). - Defaults (
etc/config.xml): disabled globally; enabled for websiteukwithhello@agrekom.co.uk. - Template:
view/frontend/email/order_additional.html, based on the core guest order template. It passesshow_additional_ean="1"to the items layout, which makes the theme overrides above render theadditional_eanattribute under the EAN. The line is omitted when the attribute is empty, and configurable items read the value from the ordered variant.
Why a separate module exists at all
Having a dedicated module gives Agrekom's email customizations their own identity in
app/etc/config.php and module:status, independent of the theme. This matters because:
- it can be enabled/disabled on its own without touching theme registration,
- future PHP-level customizations (e.g. plugins/preferences for
Magento\Sales\Model\Order\Email\Sender, custom email variables, observers) have a natural home here instead of being bolted onto an unrelated module, - it keeps an explicit audit trail in
setup_module/module:statusof what "email template customization" means in this codebase.
Known history / gotchas
etc/module.xmlpreviously declared the wrong module name (MageSuite_LowestPriceLoggerFrontend, a leftover copy-paste fromagrekom/customization-magesuite-lowest-price-logger-frontend), which conflicted with that other, legitimate module and meantAgrekom_CustomizationEmailTemplatewas never actually enabled. This has been fixed —module.xmlnow correctly declaresAgrekom_CustomizationEmailTemplate, matchingregistration.php.After changing
etc/module.xml(name, sequence) run:bin/magento module:enable Agrekom_CustomizationEmailTemplate bin/magento setup:upgrade
Requirements
magento/framework(seecomposer.json)