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
d09e6a97
Commit
d09e6a97
authored
Oct 04, 2016
by
Torsten Oppermann
Browse files
[TASK] Fixing Preview Mail, now shows markes
parent
df470ae7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Classes/Controller/MailController.php
View file @
d09e6a97
...
...
@@ -283,7 +283,7 @@ class MailController extends ActionController {
$mailTemplateService
->
setTemplateName
(
$selectedTemplateKey
);
$mailTemplateService
->
setExtensionKey
(
$selectedExtensionKey
);
if
(
$mailTemplateService
->
sendEmail
())
{
if
(
$mailTemplateService
->
sendEmail
(
true
))
{
$message
=
LocalizationUtility
::
translate
(
'backend.success_mail'
,
'sg_mail'
);
$this
->
addFlashMessage
(
$message
,
''
,
FlashMessage
::
OK
);
}
else
{
...
...
Classes/Service/MailTemplateService.php
View file @
d09e6a97
...
...
@@ -193,13 +193,10 @@ class MailTemplateService {
/**
* Send the Email
*
* @param boolean $isPreview
* @return boolean email was sent or added to mail queue successfully?
*/
public
function
sendEmail
()
{
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
/** @var StandaloneView $emailView */
$emailView
=
$objectManager
->
get
(
StandaloneView
::
class
);
public
function
sendEmail
(
$isPreview
=
FALSE
)
{
/** @var Template $template */
$template
=
$this
->
templateRepository
->
findTemplate
(
...
...
@@ -219,6 +216,23 @@ class MailTemplateService {
}
}
if
(
$isPreview
)
{
if
(
!
isset
(
$defaultTemplateContent
))
{
$this
->
mailMessage
->
setBody
(
$template
->
getContent
());
$this
->
mailMessage
->
setSubject
(
$template
->
getSubject
());
}
else
{
$this
->
mailMessage
->
setBody
(
$defaultTemplateContent
);
$this
->
mailMessage
->
setSubject
(
''
);
}
$this
->
mailMessage
->
send
();
return
TRUE
;
}
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
/** @var StandaloneView $emailView */
$emailView
=
$objectManager
->
get
(
StandaloneView
::
class
);
if
(
!
isset
(
$defaultTemplateContent
))
{
$emailView
->
setTemplateSource
(
$template
->
getContent
());
$this
->
mailMessage
->
setSubject
(
$template
->
getSubject
());
...
...
Resources/Private/Language/locallang.xlf
View file @
d09e6a97
...
...
@@ -34,7 +34,7 @@
<source>
Language (Reloads the page):
</source>
</trans-unit>
<trans-unit
id=
"backend.send_test"
>
<source>
Send
Test Em
ail
</source>
<source>
Send
Preview M
ail
</source>
</trans-unit>
<trans-unit
id=
"backend.subject"
>
<source>
Subject:
</source>
...
...
@@ -65,4 +65,4 @@
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
</xliff>
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