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
ff9adcf1
Commit
ff9adcf1
authored
7 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.sgalinski.de:typo3/sg_mail into HEAD
parents
9b55167b
9aaf1728
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Service/MailTemplateService.php
+15
-8
15 additions, 8 deletions
Classes/Service/MailTemplateService.php
with
15 additions
and
8 deletions
Classes/Service/MailTemplateService.php
+
15
−
8
View file @
ff9adcf1
...
...
@@ -66,7 +66,7 @@ class MailTemplateService {
/**
* @var array $ccAddresses
*/
private
$ccAddresses
=
[]
;
private
$ccAddresses
;
/**
* @var string $replyToAddress
...
...
@@ -108,12 +108,12 @@ class MailTemplateService {
*
* @var array $tsSettings
*/
private
$tsSettings
=
[]
;
private
$tsSettings
;
/**
* @var array $bccAddresses
*/
private
$bccAddresses
=
[]
;
private
$bccAddresses
;
/**
* @var int
...
...
@@ -147,6 +147,8 @@ class MailTemplateService {
/**
* MailTemplateService constructor.
*
* @throws \InvalidArgumentException
*/
public
function
__construct
()
{
/** @var ObjectManager objectManager */
...
...
@@ -221,10 +223,11 @@ class MailTemplateService {
/**
* call in extlocalconf of an extension if you have a custom register class
*
* @param RegisterInterface
* @param boolean Should the object initialize itself ?
* @param RegisterInterface
$fileNameWithNamespace
* @param boolean
$initObject
Should the object initialize itself ?
*
* @return bool
* @throws \InvalidArgumentException
*/
public
static
function
registerByFile
(
$fileNameWithNamespace
,
$initObject
=
TRUE
)
{
$registerObject
=
GeneralUtility
::
makeInstance
(
$fileNameWithNamespace
);
...
...
@@ -331,7 +334,7 @@ class MailTemplateService {
$defaultTemplateContent
=
file_get_contents
(
$templatePath
.
$this
->
language
.
'.template.html'
);
}
else
{
// no language found and no default template
$this
->
setLanguage
(
'en'
);
$this
->
setLanguage
(
$this
->
tsSettings
[
'templateDefaultLanguage'
]
?:
'en'
);
// does an english default template exist ?
if
(
file_exists
(
$templatePath
.
$this
->
language
.
'.template.html'
))
{
$this
->
sendEmail
();
...
...
@@ -344,6 +347,7 @@ class MailTemplateService {
if
(
$isPreview
)
{
$previewMarker
=
[];
/** @var array $markerArray */
$markerArray
=
self
::
$registerArray
[
$this
->
extensionKey
][
$this
->
templateName
][
'marker'
];
foreach
(
$markerArray
as
$marker
)
{
if
(
$marker
[
'backend_translation_key'
])
{
...
...
@@ -361,7 +365,7 @@ class MailTemplateService {
/** @var StandaloneView $emailView */
$emailView
=
$this
->
objectManager
->
get
(
StandaloneView
::
class
);
if
(
!
isset
(
$defaultTemplateContent
)
)
{
if
(
null
===
$defaultTemplateContent
)
{
$emailView
->
setTemplateSource
(
$template
->
getContent
());
$subject
=
$template
->
getSubject
();
}
else
{
...
...
@@ -412,6 +416,7 @@ class MailTemplateService {
* @param int $sendingTime
* @param int $priority
* @param bool $sent
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/
private
function
addMailToMailQueue
(
$extensionKey
,
$templateName
,
$subject
,
$emailBody
,
$priority
,
$sendingTime
=
0
,
$sent
=
FALSE
...
...
@@ -440,6 +445,8 @@ class MailTemplateService {
* Send a Mail from the queue, identified by its id
*
* @param int $uid
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException
*/
public
function
sendMailFromQueue
(
$uid
)
{
$mailRepository
=
$this
->
objectManager
->
get
(
MailRepository
::
class
);
...
...
@@ -601,7 +608,7 @@ class MailTemplateService {
/**
* @param Swift_OutputByteStream $data
* @param string $
path
* @param string $
filename
* @param string $contentType
* @return MailTemplateService
*/
...
...
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