In addition to Mathias Brodala's correct answer, you can also use templateName
and templateRootPaths
inside each email finisher. It will respect the email format you set with options.format
if configured like below:
finishers:
-
identifier: EmailToReceiver
options:
subject: 'E-Mail from website'
recipientAddress: your.company@example.com
recipientName: 'Your Company name'
senderAddress: '{email}'
senderName: '{lastname}'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: 'true'
templateName: '{@format}.html'
templateRootPaths:
20: 'EXT:your_extension/Resources/Private/Forms/Emails/Receiver/'
translation:
language: ''
-
identifier: EmailToSender
options:
subject: 'Your message'
recipientAddress: '{email}'
recipientName: '{lastname}'
senderAddress: your.company@example.com
senderName: 'Your Company name'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: 'true'
templateName: '{@format}.html'
templateRootPaths:
20: 'EXT:your_extension/Resources/Private/Forms/Emails/Sender/'
According to the file paths set above, the templates are then saved in
- your_extension/Resources/Private/Forms/Emails/Sender/
Html.html or Plaintext.html
- your_extension/Resources/Private/Forms/Emails/Receiver/
Html.html or Plaintext.html
The complete tutorial can be found here.
On GitHub is a working TYPO3 extension with several example forms, including a form with custom mail template only for the sender.