Jump to content

Form email branding

Brand-specific HTML and plain-text emails for EXT:form-Finisher EmailToReceiver and EmailToSender: website colours, optional logo, legal footer and customisable sender addresses.

MP-Core logo

Requirements: TYPO3 13.4 or 14.3, typo3/cms-form, Site Set mpc/mp-core-form, Symfony Mailer in config/system/settings.php.

Overview

TopicBehaviour
Staff mailTemplate ContactReceiver, layout MpcoreFormEmail
Visitor confirmationTemplate ContactSender (add finisher to contact forms)
Finisher orderEmailToReceiver → EmailToSender → Redirect (recommended)
From addressSite form.email.senderEmail / form.email.senderName — not the visitor (SPF/DMARC)
Reply-To (staff mail)Visitor field in form YAML, e.g. replyToRecipients: '{email-1}': '{text-1} {name}'
Branding injectionBrandedEmailFinisher (extends core EmailFinisher) merges variables.emailBrand before send
LogoDedicated setting form.email.logo (t3://file?uid=…); no fallback to header logos

Site setting keys and defaults: Configuration (section Form (mpc/mp-core-form)).

Runtime flow

  1. Form prototype BaseSetup.yaml sets implementationClassName: Mpc\MpCore\Domain\Finishers\BrandedEmailFinisher on EmailToReceiver and EmailToSender.
  2. BrandedEmailFinisher resolves the current site from the form request.
  3. FormEmailBrandingBuilder builds the emailBrand array (logo URL, homepage, colours, footer HTML/plain).
  4. Core EmailFinisher sends FluidEmail using your form’s templateName and the bundled layout/templates.

PHP classes

ClassRole
Mpc\MpCore\Domain\Finishers\BrandedEmailFinisherInjects emailBrand into finisher options
Mpc\MpCore\Service\FormEmailBrandingBuilderBuilds branding from site settings
Mpc\MpCore\Service\SiteLogoResolverResolves t3://file?uid=… to a public URL

Finisher DI is registered in Configuration/Services.php when EXT:form is loaded.

Site settings (form.email.*)

Configure in Site Management → MPCoreForm or config/sites/<site>/settings.yaml:

 
form.email.senderEmail: noreply@example.com
form.email.senderName: 'Website Contact example.com'
form.email.replyToEmail: mail@example.com
form.email.logo: 't3://file?uid=1234'
form.email.logoAlt: 'Company logo'
form.email.headerColor: ''   # empty = site color-primary
form.email.footerColor: ''   # empty = site color-secondary
form.email.footerText: ''    # empty = copyright + Imprint/Privacy from site / mpcConsent.*
 

Upload the mail logo to fileadmin and reference its FAL uid. Empty form.email.logo means no logo in the mail header.

Legal footer fallback uses copyrightText, and mpcConsent.imprintPage / mpcConsent.privacyPolicyPage when form.email.footerText is empty. Custom footer HTML is sanitized in the layout; plain text uses footerTextPlain.

Form definitions (per form)

In the Form module or exported YAML (e.g. fileadmin/form_definitions/):

EmailToReceiver

  • templateName: ContactReceiver
  • senderAddress / senderName: site addresses (match form.email.* or literals)
  • replyToRecipients: visitor mapping (adjust field identifiers)
  • recipients: staff inbox
  • addHtmlPart: true (recommended)
  • message: HTML intro; use {formValues} where needed

EmailToSender

  • templateName: ContactSender
  • recipients: visitor mapping
  • senderAddress / senderName: site (not visitor)
  • addHtmlPart: true
  • Localized subject and title

Example persistence ids on mpcore: kontakt_1 (DE), contact_1 (EN).

Extension assets (do not copy to fileadmin)

PathPurpose
Resources/Extensions/form/Yaml/BaseSetup.yamlPrototype + BrandedEmailFinisher
Resources/Extensions/form/Frontend/Layouts/MpcoreFormEmail.fluid.*HTML/plain shell
Resources/Extensions/form/Frontend/Templates/Finishers/Email/ContactReceiver.fluid.*Staff body
Resources/Extensions/form/Frontend/Templates/Finishers/Email/ContactSender.fluid.*Visitor confirmation
Resources/Extensions/form/Frontend/Partials/Finishers/Email/ContactFormValues.fluid.*Value table (skips honeypot/spam noise)
Configuration/Sets/mp-core-form/Site set defaults and editor fields

Custom templates: set templateName on the finisher, add Fluid under the prototype templateRootPaths, use layout MpcoreFormEmail.

emailBrand Fluid variables

VariableSource
emailBrand.logoUrlform.email.logo
emailBrand.logoAltform.email.logoAlt
emailBrand.homeUrlLanguage homepage
emailBrand.headerBackgroundColorform.email.headerColor or color-primary
emailBrand.footerBackgroundColorform.email.footerColor or color-secondary
emailBrand.linkColorcolor-tertiary (fallback #1f5aad)
emailBrand.footerTextCustom or auto HTML footer
emailBrand.footerTextPlainPlain footer for .fluid.txt

Verification

  1. Submit contact forms on the public site (staff + visitor mails).
  2. Staff mail: branding, value table, Reply-To = visitor.
  3. Visitor mail: confirmation, From = site noreply.
  4. Check HTML and plain parts in the mail client.
  5. Optional: composer test:unit — FormEmailBrandingBuilderTest.

Troubleshooting

SymptomLikely cause
500 on summary/submitUpgrade mp-core ≥ 1.3.5, typo3 cache:flush
No logoEmpty or invalid form.email.logo
Core orange / Default templateWrong templateName or stale cache
Reply goes to wrong addressMissing replyToRecipients on staff finisher
Raw in plain mailUse current ContactFormValues.fluid.txt from the extension

Multi-step form summary UI and fieldset headings (page + mail) changed in 1.3.4+. See CHANGELOG [1.3.4] / [1.3.5] and Backend (Form YAML / Fieldset inspector).

Share page