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
4c3d0f32
Commit
4c3d0f32
authored
Sep 27, 2016
by
Torsten Oppermann
Browse files
[TASK] Refactoring naming and removing unnecessary default template creation
parent
07ddf861
Changes
1
Hide whitespace changes
Inline
Side-by-side
Classes/Service/MailTemplateService.php
View file @
4c3d0f32
...
...
@@ -91,7 +91,7 @@ class MailTemplateService {
/**
* @var array content
*/
private
$
content
=
[];
private
$
markers
=
[];
/**
* @var string subject
...
...
@@ -113,24 +113,18 @@ class MailTemplateService {
* @param string $templateName
* @param string $templatePath
* @param string $description
* @param array $marker
* @param array $marker
s
* @return string
*/
public
static
function
registerTemplate
(
$extension
,
$templateName
,
$templatePath
,
$description
,
array
$marker
)
{
public
static
function
registerTemplate
(
$extension
,
$templateName
,
$templatePath
,
$description
,
array
$marker
s
)
{
MailTemplateService
::
$registerArray
[
$extension
][
$templateName
]
=
[
'templatePath'
=>
$templatePath
,
'description'
=>
$description
,
'marker'
=>
$marker
,
'marker'
=>
$marker
s
,
'extension'
=>
$extension
,
'templateName'
=>
$templateName
];
$defaultLangFile
=
$templatePath
.
'en.sg_mail.locallang.html'
;
if
(
!
file_exists
(
$defaultLangFile
))
{
$langFileContent
=
''
;
file_put_contents
(
$defaultLangFile
,
$langFileContent
);
}
}
/**
...
...
@@ -143,7 +137,7 @@ class MailTemplateService {
}
/**
*
s
end the
Email
*
S
end the Email
*/
public
function
sendEmail
()
{
$registerArray
=
MailTemplateService
::
getRegisterArray
();
...
...
@@ -154,7 +148,7 @@ class MailTemplateService {
$emailView
->
setTemplatePathAndFilename
(
$templateEntry
[
'templatePath'
]
.
$this
->
language
.
'.sg_mail.locallang.html'
);
$emailView
->
assignMultiple
(
$this
->
content
);
$emailView
->
assignMultiple
(
$this
->
markers
);
$emailBody
=
$emailView
->
render
();
if
(
$this
->
ignoreMailQueue
)
{
...
...
@@ -287,11 +281,11 @@ class MailTemplateService {
}
/**
* @param array $
content
* @param array $
markers
* @return MailTemplateService
*/
public
function
set
Content
(
array
$
content
)
{
$this
->
content
=
$content
;
public
function
set
Markers
(
array
$
markers
)
{
$this
->
markers
=
$markers
;
return
$this
;
}
}
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