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
18a735a6
Commit
18a735a6
authored
Oct 05, 2016
by
Stefan Galinski
🎮
Browse files
[BUGFIX] Fix more issues with the mail queue
parent
80a80984
Changes
1
Hide whitespace changes
Inline
Side-by-side
Classes/Service/MailTemplateService.php
View file @
18a735a6
...
...
@@ -151,11 +151,11 @@ class MailTemplateService {
}
}
if
(
sizeof
(
$this
->
bccAddresses
)
>
0
)
{
if
(
count
(
$this
->
bccAddresses
)
>
0
)
{
$this
->
mailMessage
->
setBcc
(
$this
->
bccAddresses
);
}
if
(
sizeof
(
$this
->
ccAddresses
)
>
0
)
{
if
(
count
(
$this
->
ccAddresses
)
>
0
)
{
$this
->
mailMessage
->
setCc
(
$this
->
ccAddresses
);
}
}
...
...
@@ -214,6 +214,7 @@ class MailTemplateService {
// no language found and no default template
$this
->
setLanguage
(
'en'
);
$this
->
sendEmail
();
return
TRUE
;
}
}
...
...
@@ -233,13 +234,12 @@ class MailTemplateService {
if
(
!
isset
(
$defaultTemplateContent
))
{
$emailView
->
setTemplateSource
(
$template
->
getContent
());
$
this
->
mailMessage
->
setS
ubject
(
$template
->
getSubject
()
)
;
$
s
ubject
=
$template
->
getSubject
();
}
else
{
$emailView
->
setTemplateSource
(
$defaultTemplateContent
);
$this
->
mailMessage
->
setSubject
(
self
::
$registerArray
[
$this
->
extensionKey
][
$this
->
templateName
][
'subjects'
][
$this
->
language
]
);
$subject
=
self
::
$registerArray
[
$this
->
extensionKey
][
$this
->
templateName
][
'subjects'
][
$this
->
language
];
}
$this
->
mailMessage
->
setSubject
(
$subject
);
$emailView
->
assignMultiple
(
$this
->
markers
);
$emailBody
=
$emailView
->
render
();
...
...
@@ -252,7 +252,7 @@ class MailTemplateService {
$this
->
mailMessage
->
setBody
(
$emailBody
,
'text/html'
);
$this
->
mailMessage
->
send
();
}
else
{
$this
->
addMailToMailQueue
(
$emailBody
,
$this
->
priority
);
$this
->
addMailToMailQueue
(
$subject
,
$emailBody
,
$this
->
priority
);
}
return
TRUE
;
...
...
@@ -261,17 +261,18 @@ class MailTemplateService {
/**
* Adds a new mail to the mail queue.
*
* @param string $subject
* @param string $emailBody
* @param int $priority
*/
private
function
addMailToMailQueue
(
$emailBody
,
$priority
)
{
private
function
addMailToMailQueue
(
$subject
,
$emailBody
,
$priority
)
{
/** @var ObjectManager $objectManager */
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
$mail
=
$objectManager
->
get
(
Mail
::
class
);
$mail
->
setFromAddress
(
$this
->
fromAddress
);
$mail
->
setToAddress
(
$this
->
toAddresses
);
$mail
->
setMailSubject
(
$
this
->
subject
);
$mail
->
setMailSubject
(
$subject
);
$mail
->
setMailBody
(
$emailBody
);
$mail
->
setPriority
(
$priority
);
$mail
->
setBccAddresses
(
implode
(
','
,
$this
->
bccAddresses
));
...
...
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