Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_mail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_mail
Commits
aed55ee2
Commit
aed55ee2
authored
8 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Email is now rendered via fluid
parent
8e236437
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Feature sg mail
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Service/MailTemplateService.php
+6
-22
6 additions, 22 deletions
Classes/Service/MailTemplateService.php
with
6 additions
and
22 deletions
Classes/Service/MailTemplateService.php
+
6
−
22
View file @
aed55ee2
...
...
@@ -85,33 +85,17 @@ class MailTemplateService {
$registerArray
=
MailTemplateService
::
getRegisterArray
();
$templateEntry
=
$registerArray
[
$extensionKey
][
$templateKey
];
$
templateFileContents
=
file_get_contents
(
$templateEntry
[
'templatePath'
]
.
$language
.
'.sg_mail.locallang.html'
);
$
body
=
MailTemplateService
::
injectEmailContent
(
$templateFileContents
,
$content
);
$
objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
$emailView
=
$objectManager
->
get
(
'TYPO3\\CMS\\Fluid\\View\\StandaloneView'
);
$emailView
->
setTemplatePathAndFilename
(
$templateEntry
[
'templatePath'
]
.
$language
.
'.sg_mail.locallang.html'
);
Stefan Galinski
@sgalinski
·
Sep 19, 2016
Owner
.sg_mail.locallang.html ist hartcoded.
.sg_mail.locallang.html ist hartcoded.
Please
register
or
sign in
to reply
$emailView
->
assignMultiple
(
$content
);
$
emailBody
=
$emailView
->
render
(
);
$mail
=
GeneralUtility
::
makeInstance
(
'TYPO3\\CMS\\Core\\Mail\\MailMessage'
);
$mail
->
setFrom
(
$fromAddress
);
$mail
->
setTo
(
$toAddress
);
$mail
->
setSubject
(
$subject
);
$mail
->
setBody
(
$
body
);
$mail
->
setBody
(
$
emailBody
,
'text/html'
);
$mail
->
send
();
}
/**
* injects content into template
*
* @param string $templateContent
* @param array $marker
* @return string
*/
private
static
function
injectEmailContent
(
$templateContent
,
array
$content
)
{
foreach
(
$content
as
$marker
=>
$value
)
{
str_replace
(
'{'
.
$marker
.
'}'
,
$value
,
$templateContent
);
}
return
$templateContent
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment