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
748cad6b
Commit
748cad6b
authored
5 years ago
by
Georgi Mateev
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] 1584 Removed unnecessary complex logic from the Newsletter and SendEmail
parent
a2711427
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!23
[BUGFIX] 1584 fix contact form placeholders
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Service/MailTemplateService.php
+13
-46
13 additions, 46 deletions
Classes/Service/MailTemplateService.php
with
13 additions
and
46 deletions
Classes/Service/MailTemplateService.php
+
13
−
46
View file @
748cad6b
...
...
@@ -828,15 +828,16 @@ class MailTemplateService {
* @param boolean $isNewsletter
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
*/
protected
function
extract
ValuesForMail
(
protected
function
parse
ValuesForMail
(
$template
,
RegisterService
$registerService
,
$defaultTemplateContent
,
$siteRootId
,
$isNewsletter
$siteRootId
):
void
{
/** @var StandaloneView $emailView */
$emailView
=
$this
->
objectManager
->
get
(
StandaloneView
::
class
);
$emailView
->
assignMultiple
(
$this
->
markers
);
$emailView
->
assign
(
'all_fields'
,
$this
->
getAllMarker
(
$this
->
markers
));
//TODO: make this as the lines below the next block
$overwrittenEmailBody
=
$this
->
getOverwrittenEmailBody
();
$overwrittenSubject
=
''
;
if
(
$this
->
subject
!==
''
&&
$this
->
subject
!==
NULL
)
{
...
...
@@ -875,57 +876,27 @@ class MailTemplateService {
// Parse the markers
if
(
$this
->
fromName
)
{
$this
->
setFromName
(
$this
->
parseMarkers
(
$this
->
fromName
,
$emailView
)
);
$this
->
setFromName
(
$this
->
parseMarkers
(
$this
->
fromName
,
$emailView
));
}
if
(
$this
->
fromAddress
)
{
$this
->
setFromAddress
(
$this
->
parseMarkers
(
$this
->
fromAddress
,
$emailView
)
);
$this
->
setFromAddress
(
$this
->
parseMarkers
(
$this
->
fromAddress
,
$emailView
));
}
if
(
$this
->
replyToAddress
)
{
$this
->
setReplyToAddress
(
$this
->
parseMarkers
(
$this
->
replyToAddress
,
$emailView
)
);
$this
->
setReplyToAddress
(
$this
->
parseMarkers
(
$this
->
replyToAddress
,
$emailView
));
}
if
(
$this
->
bccAddresses
)
{
$this
->
setCcAddresses
(
$this
->
parseMarkers
(
$this
->
ccAddresses
,
$emailView
)
);
if
(
$this
->
ccAddresses
)
{
$this
->
setCcAddresses
(
$this
->
parseMarkers
(
$this
->
ccAddresses
,
$emailView
));
}
if
(
$this
->
bccAddresses
)
{
$this
->
setBccAddresses
(
$this
->
parseMarkers
(
$this
->
bccAddresses
,
$emailView
)
);
$this
->
setBccAddresses
(
$this
->
parseMarkers
(
$this
->
bccAddresses
,
$emailView
));
}
if
(
$this
->
toAddresses
)
{
$this
->
setToAddresses
(
$this
->
parseMarkers
(
$this
->
toAddresses
,
$emailView
)
);
$this
->
setToAddresses
(
$this
->
parseMarkers
(
$this
->
toAddresses
,
$emailView
));
}
// reset template source back to default
...
...
@@ -994,12 +965,7 @@ class MailTemplateService {
$this
->
setToAddresses
(
\trim
(
$template
->
getToAddress
()));
}
$this
->
extractValuesForMail
(
$template
,
$registerService
,
$defaultTemplateContent
,
$siteRootId
,
$isNewsletter
);
// Fallback empty recipient address to the default sender address
if
(
!
$this
->
mailMessage
->
getTo
())
{
$this
->
mailMessage
->
setTo
(
$this
->
defaultFromAddress
);
}
$this
->
parseValuesForMail
(
$template
,
$registerService
,
$defaultTemplateContent
,
$siteRootId
);
$mail
=
$this
->
addMailToMailQueue
(
$this
->
extensionKey
,
$this
->
templateName
,
$this
->
getSubjectToSend
(),
$this
->
getMailBodyToSend
(),
...
...
@@ -1308,7 +1274,7 @@ class MailTemplateService {
*
* @param Template $template
*/
private
function
loadTemplateValues
(
$template
):
void
{
private
function
loadTemplateValues
(
Template
$template
):
void
{
$fromName
=
\trim
(
$template
->
getFromName
());
if
(
$fromName
===
''
)
{
$fromName
=
$this
->
fromName
;
...
...
@@ -1318,6 +1284,7 @@ class MailTemplateService {
}
$fromMail
=
$this
->
getValidFromMail
(
\trim
(
$template
->
getFromMail
()));
// The setters check if the value is empty or not
$this
->
setFromAddress
(
$fromMail
,
$fromName
);
$this
->
setCcAddresses
(
$template
->
getCc
());
$this
->
setBccAddresses
(
$template
->
getBcc
());
...
...
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