Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TYPO3
sg_mail
Commits
dcb71303
Commit
dcb71303
authored
Sep 17, 2019
by
Fabian Galinski
😾
Browse files
[FEATURE] Adds a function to overwrite the email body
parent
752f8469
Changes
1
Hide whitespace changes
Inline
Side-by-side
Classes/Service/MailTemplateService.php
View file @
dcb71303
...
...
@@ -104,6 +104,11 @@ class MailTemplateService {
*/
private
$subject
;
/**
* @var string $overwrittenEmailBody
*/
private
$overwrittenEmailBody
=
''
;
/**
* @var string $extensionKey
*/
...
...
@@ -486,6 +491,20 @@ class MailTemplateService {
$this
->
subject
=
$subject
;
}
/**
* @return string
*/
public
function
getOverwrittenEmailBody
():
string
{
return
$this
->
overwrittenEmailBody
;
}
/**
* @param string $overwrittenEmailBody
*/
public
function
setOverwrittenEmailBody
(
string
$overwrittenEmailBody
):
void
{
$this
->
overwrittenEmailBody
=
$overwrittenEmailBody
;
}
/**
* Return default markers for sg_mail
*
...
...
@@ -662,7 +681,8 @@ class MailTemplateService {
$emailView
->
setTemplateSource
(
\
trim
(
$template
->
getSubject
()));
$subject
=
$emailView
->
render
();
$emailView
->
setTemplateSource
(
$template
->
getContent
());
$overwrittenEmailBody
=
$this
->
getOverwrittenEmailBody
();
$emailView
->
setTemplateSource
(
empty
(
$overwrittenEmailBody
)
?
$template
->
getContent
()
:
$overwrittenEmailBody
);
}
else
{
$subject
=
$registerService
->
getRegisterArray
()[
$this
->
extensionKey
][
$this
->
templateName
][
'subject'
];
if
(
\
is_array
(
$subject
))
{
...
...
@@ -678,7 +698,7 @@ class MailTemplateService {
$emailView
->
setTemplateSource
(
$subject
);
$subject
=
$emailView
->
render
();
}
$emailView
->
setTemplateSource
(
$defaultTemplateContent
);
$emailView
->
setTemplateSource
(
empty
(
$overwrittenEmailBody
)
?
$defaultTemplateContent
:
$overwrittenEmailBody
);
}
if
(
$this
->
subject
!==
''
&&
$this
->
subject
!==
NULL
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment