Commit 610d3ad5 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Adding subject setter to mail service, working on translations

parent b9f6760a
......@@ -96,6 +96,11 @@ class MailTemplateService {
*/
private $templateName;
/**
* @var string $subject
*/
private $subject;
/**
* @var string $extensionKey
*/
......@@ -333,6 +338,11 @@ class MailTemplateService {
)[$this->extensionKey][$this->templateName]['subject'][$this->language];
}
}
if ($subject === '' || $subject === NULL) {
$subject = $this->subject;
}
$this->mailMessage->setSubject($subject);
$emailView->assignMultiple($this->markers);
......@@ -763,4 +773,18 @@ class MailTemplateService {
return TRUE;
}
/**
* @return string
*/
public function getSubject(): string {
return $this->subject;
}
/**
* @param string $subject
*/
public function setSubject(string $subject) {
$this->subject = $subject;
}
}
......@@ -33,4 +33,12 @@ module.tx_form.settings.yamlConfigurations {
1499086547 = EXT:sg_mail/Configuration/Yaml/Forms/BaseSetup.yaml
1499086867 = EXT:sg_mail/Configuration/Yaml/Forms/FormEditorSetup.yaml
1499088215 = EXT:sg_mail/Configuration/Yaml/Forms/FormEngineSetup.yaml
}
plugin.tx_form {
settings {
yamlConfigurations {
11254100 = EXT:sg_mail/Configuration/Yaml/Forms/CustomFormSetup.yaml
}
}
}
\ No newline at end of file
......@@ -9,6 +9,9 @@ TYPO3:
prototypes:
standard:
formEngine:
translationFile: 'EXT:sg_mail/Resources/Private/Language/locallang_db.xlf'
# LLL:EXT:myExtension/Resources/Private/Language/locallang.xml:domain_model_whatever.title
finishersDefinition:
MailToSenderFinisher:
implementationClassName: SGalinski\SgMail\Finisher\Forms\FormsFinisher
......
TYPO3:
CMS:
Form:
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
translation:
translationFile:
# default translation files for the frontend
10: 'EXT:form/Resources/Private/Language/locallang.xlf'
20: 'EXT:sg_mail/Resources/Private/Language/locallang_db.xlf'
# translationFile: 'EXT:sg_mail/Resources/Private/Language/locallang_db.xlf'
......@@ -12,10 +12,11 @@ TYPO3:
selectOptions:
25:
value: 'MailToSenderFinisher'
label: 'SgMail - Mail to Website user'
# label: 'Mail Templates - Mail to the website user'
label: 'tt_content.finishersDefinition.EmailToSender.format.label'
35:
value: 'MailToReceiverFinisher'
label: 'SgMail - E-Mail to Admin'
label: 'Mail Templates - E-Mail to the website admin'
propertyCollections:
finishers:
# define the finishers field
......@@ -25,7 +26,9 @@ TYPO3:
__inheritances:
10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseCollectionEditorsMixin'
100:
label: "SgMail - E-Mail to website user"
# label: "Mail Templates - E-Mail to the website user"
label: 'sg_mail.finishersDefinition.MailToSenderFinisher.label'
110:
identifier: 'template'
templateName: 'Inspector-SingleSelectEditor'
......@@ -64,12 +67,12 @@ TYPO3:
160:
identifier: 'subject'
templateName: 'Inspector-TextEditor'
label: 'The Subject of the E-Mail'
label: 'The subject of the E-Mail'
propertyPath: 'options.subject'
170:
identifier: 'userName'
templateName: 'Inspector-TextEditor'
label: 'The Name of the Website user'
label: 'The name of the website user'
propertyPath: 'options.userName'
enableFormelementSelectionButton: true
propertyValidators:
......@@ -78,17 +81,17 @@ TYPO3:
190:
identifier: 'replyTo'
templateName: 'Inspector-TextEditor'
label: 'The reply to Address of the E-Mail'
label: 'The reply to address of the E-Mail'
propertyPath: 'options.replyTo'
200:
identifier: 'cc'
templateName: 'Inspector-TextEditor'
label: 'The cc Address of the E-Mail'
label: 'The cc address of the E-Mail'
propertyPath: 'options.cc'
210:
identifier: 'bcc'
templateName: 'Inspector-TextEditor'
label: 'The bcc Address of the E-Mail'
label: 'The bcc address of the E-Mail'
propertyPath: 'options.bcc'
35:
identifier: 'MailToReceiverFinisher'
......@@ -96,7 +99,7 @@ TYPO3:
__inheritances:
10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseCollectionEditorsMixin'
100:
label: "SgMail - E-Mail to Website Admin"
label: "Mail Templates - E-Mail to the website admin"
110:
identifier: 'template'
templateName: 'Inspector-SingleSelectEditor'
......@@ -121,7 +124,7 @@ TYPO3:
120:
identifier: 'mailTo'
templateName: 'Inspector-TextEditor'
label: 'The email address of the admin'
label: 'The email address of the website admin'
propertyPath: 'options.mailTo'
125:
identifier: 'mailFrom'
......@@ -131,22 +134,22 @@ TYPO3:
160:
identifier: 'subject'
templateName: 'Inspector-TextEditor'
label: 'The Subject of the E-Mail'
label: 'The subject of the E-Mail'
propertyPath: 'options.subject'
190:
identifier: 'replyTo'
templateName: 'Inspector-TextEditor'
label: 'The reply to Address of the E-Mail'
label: 'The "reply to" address of the E-Mail'
propertyPath: 'options.replyTo'
200:
identifier: 'cc'
templateName: 'Inspector-TextEditor'
label: 'The cc Address of the E-Mail'
label: 'The cc address of the E-Mail'
propertyPath: 'options.cc'
210:
identifier: 'bcc'
templateName: 'Inspector-TextEditor'
label: 'The bcc Address of the E-Mail'
label: 'The bcc address of the E-Mail'
propertyPath: 'options.bcc'
# Backend options
finishersDefinition:
......
renderingOptions:
submitButtonLabel: Submit
submitButtonLabel: element.Form.renderingOptions.submitButtonLabel
type: Form
identifier: contactForm
label: 'Contact Form'
......@@ -41,10 +41,9 @@ renderables:
defaultValue: ''
type: Text
identifier: text-1
label: Name
label: ''
properties:
fluidAdditionalAttributes:
placeholder: Name
required: required
elementDescription: ''
validators:
......
......@@ -9,6 +9,26 @@
<authorEmail>torsten@sgalinski.de</authorEmail>
</header>
<body>
<trans-unit id="ContactForm.element.Name.properties.label" approved="yes">
<source>Name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="contactForm.element.text-1.properties.label" approved="yes">
<source>Name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="element.Form.renderingOptions.submitButtonLabel" approved="yes">
<source>Submit</source>
<target>Jetzt absenden</target>
</trans-unit>
<trans-unit id="element.Name.properties.label" approved="yes">
<source>Name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="sg_mail.forms.submit" approved="yes">
<source>Submit</source>
<target>Jetzt absenden</target>
</trans-unit>
<trans-unit id="tx_sgmail_domain_model_mail" approved="yes">
<source>Mail Queue Entry</source>
<target>Mail-Queue-Eintrag</target>
......
......@@ -9,6 +9,21 @@
<authorEmail>torsten@sgalinski.de</authorEmail>
</header>
<body>
<trans-unit id="ContactForm.element.Name.properties.label">
<source>Name</source>
</trans-unit>
<trans-unit id="contactForm.element.text-1.properties.label">
<source>Name</source>
</trans-unit>
<trans-unit id="element.Form.renderingOptions.submitButtonLabel">
<source>Submit</source>
</trans-unit>
<trans-unit id="element.Name.properties.label">
<source>Name</source>
</trans-unit>
<trans-unit id="sg_mail.forms.submit">
<source>Submit</source>
</trans-unit>
<trans-unit id="tx_sgmail_domain_model_mail">
<source>Mail Queue Entry</source>
</trans-unit>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment