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
918ba1bc
Commit
918ba1bc
authored
8 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Adding Priority to mail service
parent
87af1e16
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
+17
-3
17 additions, 3 deletions
Classes/Service/MailTemplateService.php
with
17 additions
and
3 deletions
Classes/Service/MailTemplateService.php
+
17
−
3
View file @
918ba1bc
...
@@ -5,7 +5,6 @@ namespace SGalinski\SgMail\Service;
...
@@ -5,7 +5,6 @@ namespace SGalinski\SgMail\Service;
use
SGalinski\SgMail\Domain\Model\Mail
;
use
SGalinski\SgMail\Domain\Model\Mail
;
use
SGalinski\SgMail\Domain\Model\Template
;
use
SGalinski\SgMail\Domain\Model\Template
;
use
SGalinski\SgMail\Domain\Repository\MailRepository
;
use
SGalinski\SgMail\Domain\Repository\MailRepository
;
use
TYPO3\CMS\Core\Exception
;
use
TYPO3\CMS\Core\Mail\MailMessage
;
use
TYPO3\CMS\Core\Mail\MailMessage
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Extbase\Object\ObjectManager
;
use
TYPO3\CMS\Extbase\Object\ObjectManager
;
...
@@ -112,6 +111,11 @@ class MailTemplateService {
...
@@ -112,6 +111,11 @@ class MailTemplateService {
*/
*/
private
$bccAddresses
=
[];
private
$bccAddresses
=
[];
/**
* @var int
*/
private
$priority
=
Mail
::
PRIORITY_LOWEST
;
/**
/**
* @var \SGalinski\SgMail\Domain\Repository\TemplateRepository
* @var \SGalinski\SgMail\Domain\Repository\TemplateRepository
* @inject
* @inject
...
@@ -225,7 +229,7 @@ class MailTemplateService {
...
@@ -225,7 +229,7 @@ class MailTemplateService {
$this
->
mailMessage
->
setBody
(
$emailBody
,
'text/html'
);
$this
->
mailMessage
->
setBody
(
$emailBody
,
'text/html'
);
$this
->
mailMessage
->
send
();
$this
->
mailMessage
->
send
();
}
else
{
}
else
{
$this
->
addMailToMailQueue
(
$emailBody
);
$this
->
addMailToMailQueue
(
$emailBody
,
$this
->
priority
);
}
}
return
TRUE
;
return
TRUE
;
...
@@ -238,7 +242,7 @@ class MailTemplateService {
...
@@ -238,7 +242,7 @@ class MailTemplateService {
* @param int $priority
* @param int $priority
* @param int $pid
* @param int $pid
*/
*/
private
function
addMailToMailQueue
(
$emailBody
,
$priority
=
Mail
::
PRIORITY_LOWEST
,
$pid
=
0
)
{
private
function
addMailToMailQueue
(
$emailBody
,
$priority
,
$pid
=
0
)
{
/** @var ObjectManager $objectManager */
/** @var ObjectManager $objectManager */
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
...
@@ -371,4 +375,14 @@ class MailTemplateService {
...
@@ -371,4 +375,14 @@ class MailTemplateService {
return
$this
;
return
$this
;
}
}
/**
* @param int $priority
* @return MailTemplateService
*/
public
function
setPriority
(
$priority
)
{
$this
->
priority
=
$priority
;
return
$this
;
}
}
}
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