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
c5a11509
Commit
c5a11509
authored
8 years ago
by
Fabian Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Fixing of the domain models
parent
6ca3110c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Feature sg mail
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Classes/Controller/MailController.php
+2
-2
2 additions, 2 deletions
Classes/Controller/MailController.php
Classes/Domain/Model/Mail.php
+20
-20
20 additions, 20 deletions
Classes/Domain/Model/Mail.php
Classes/Service/MailTemplateService.php
+15
-3
15 additions, 3 deletions
Classes/Service/MailTemplateService.php
with
37 additions
and
25 deletions
Classes/Controller/MailController.php
+
2
−
2
View file @
c5a11509
...
...
@@ -220,12 +220,12 @@ class MailController extends ActionController {
// @todo Die "From email" sollte eine TypoScript-Konfiguration sein.
MailTemplateService
::
sendEmail
(
$selectedLanguageLeft
,
$selectedTemplateKey
,
$selectedExtensionKey
,
$emailAddress
,
'test@sgmail.de'
,
'This is just a Test E-Mail'
'This is just a Test E-Mail'
,
[],
TRUE
);
MailTemplateService
::
sendEmail
(
$selectedLanguageRight
,
$selectedTemplateKey
,
$selectedExtensionKey
,
$emailAddress
,
'test@sgmail.de'
,
'This is just a Test E-Mail'
'This is just a Test E-Mail'
,
[],
TRUE
);
// @todo SgMail -> sg_mail | Evtl. kein Fehler, da TYPO3 das für dich macht :)
...
...
This diff is collapsed.
Click to expand it.
Classes/Domain/Model/Mail.php
+
20
−
20
View file @
c5a11509
...
...
@@ -42,22 +42,22 @@ class Mail extends AbstractEntity {
/**
* @var string
*/
protected
$mail
_s
ubject
=
''
;
protected
$mail
S
ubject
=
''
;
/**
* @var string
*/
protected
$mail
_b
ody
=
''
;
protected
$mail
B
ody
=
''
;
/**
* @var string
*/
protected
$to
_a
ddress
=
''
;
protected
$to
A
ddress
=
''
;
/**
* @var string
*/
protected
$from
_a
ddress
=
''
;
protected
$from
A
ddress
=
''
;
/**
* @var bool
...
...
@@ -73,60 +73,60 @@ class Mail extends AbstractEntity {
* @return string
*/
public
function
getMailSubject
()
{
return
$this
->
mail
_s
ubject
;
return
$this
->
mail
S
ubject
;
}
/**
* @param string $mail
_s
ubject
* @param string $mail
S
ubject
* @return void
*/
public
function
setMailSubject
(
$mail
_s
ubject
)
{
$this
->
mail
_s
ubject
=
$mail
_s
ubject
;
public
function
setMailSubject
(
$mail
S
ubject
)
{
$this
->
mail
S
ubject
=
$mail
S
ubject
;
}
/**
* @return string
*/
public
function
getMailBody
()
{
return
$this
->
mail
_b
ody
;
return
$this
->
mail
B
ody
;
}
/**
* @param string $mail
_b
ody
* @param string $mail
B
ody
* @return void
*/
public
function
setMailBody
(
$mail
_b
ody
)
{
$this
->
mail
_b
ody
=
$mail
_b
ody
;
public
function
setMailBody
(
$mail
B
ody
)
{
$this
->
mail
B
ody
=
$mail
B
ody
;
}
/**
* @return string
*/
public
function
getToAddress
()
{
return
$this
->
to
_a
ddress
;
return
$this
->
to
A
ddress
;
}
/**
* @param string $to
_a
ddress
* @param string $to
A
ddress
* @return void
*/
public
function
setToAddress
(
$to
_a
ddress
)
{
$this
->
to
_a
ddress
=
$to
_a
ddress
;
public
function
setToAddress
(
$to
A
ddress
)
{
$this
->
to
A
ddress
=
$to
A
ddress
;
}
/**
* @return string
*/
public
function
getFromAddress
()
{
return
$this
->
from
_a
ddress
;
return
$this
->
from
A
ddress
;
}
/**
* @param string $from
_a
ddress
* @param string $from
A
ddress
* @return void
*/
public
function
setFromAddress
(
$from
_a
ddress
)
{
$this
->
from
_a
ddress
=
$from
_a
ddress
;
public
function
setFromAddress
(
$from
A
ddress
)
{
$this
->
from
A
ddress
=
$from
A
ddress
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Classes/Service/MailTemplateService.php
+
15
−
3
View file @
c5a11509
...
...
@@ -4,6 +4,7 @@ namespace SGalinski\SgMail\Service;
use
SGalinski\SgMail\Domain\Model\Mail
;
use
SGalinski\SgMail\Domain\Repository\MailRepository
;
use
TYPO3\CMS\Core\Mail\MailMessage
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Extbase\Object\ObjectManager
;
...
...
@@ -86,9 +87,11 @@ class MailTemplateService {
* @param string $fromAddress
* @param string $subject
* @param string $content
* @param boolean $ignoreMailQueue
*/
public
static
function
sendEmail
(
$language
,
$templateKey
,
$extensionKey
,
$toAddress
,
$fromAddress
,
$subject
,
array
$content
=
[]
$language
,
$templateKey
,
$extensionKey
,
$toAddress
,
$fromAddress
,
$subject
,
array
$content
=
[],
$ignoreMailQueue
=
FALSE
)
{
// Set Email Content
$registerArray
=
MailTemplateService
::
getRegisterArray
();
...
...
@@ -101,8 +104,17 @@ class MailTemplateService {
$emailView
->
assignMultiple
(
$content
);
$emailBody
=
$emailView
->
render
();
// @todo evtl. sollten hier noch die Parameter $priority und $pid mit gegeben werden.
self
::
addMailToMailQueue
(
$fromAddress
,
$toAddress
,
$subject
,
$emailBody
);
if
(
$ignoreMailQueue
)
{
$mailMessage
=
$objectManager
->
get
(
MailMessage
::
class
);
$mailMessage
->
setFrom
(
$fromAddress
);
$mailMessage
->
setTo
(
$toAddress
);
$mailMessage
->
setSubject
(
$subject
);
$mailMessage
->
setBody
(
$emailBody
,
'text/html'
);
$mailMessage
->
send
();
}
else
{
// @todo evtl. sollten hier noch die Parameter $priority und $pid mit gegeben werden.
self
::
addMailToMailQueue
(
$fromAddress
,
$toAddress
,
$subject
,
$emailBody
);
}
}
/**
...
...
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