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
0ba2bdc8
Commit
0ba2bdc8
authored
8 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Refactoring Test Mail Generation
parent
ffa4e797
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Controller/MailController.php
+14
-16
14 additions, 16 deletions
Classes/Controller/MailController.php
Configuration/TypoScript/setup.ts
+2
-1
2 additions, 1 deletion
Configuration/TypoScript/setup.ts
with
16 additions
and
17 deletions
Classes/Controller/MailController.php
+
14
−
16
View file @
0ba2bdc8
...
...
@@ -28,7 +28,9 @@ namespace SGalinski\SgMail\Controller;
use
SGalinski\SgMail\Service\MailTemplateService
;
use
TYPO3\CMS\Core\Messaging\FlashMessage
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Extbase\Mvc\Controller\ActionController
;
use
TYPO3\CMS\Extbase\Object\ObjectManager
;
use
TYPO3\CMS\Extbase\Utility\LocalizationUtility
;
/**
...
...
@@ -70,7 +72,7 @@ class MailController extends ActionController {
$languages
[]
=
$language
->
getLocale
();
}
foreach
(
$languages
as
$currentLanguage
)
{
foreach
(
$languages
as
$currentLanguage
)
{
$this
->
writeLanguageFile
(
$currentLanguage
,
$templatePath
);
}
...
...
@@ -215,24 +217,20 @@ class MailController extends ActionController {
* @param string $selectedTemplateKey
* @param string $selectedExtensionKey
* @param string $selectedLanguageLeft
* @param string $selectedLanguageRight
*/
public
function
sendTestMailAction
(
$emailAddress
=
NULL
,
$selectedExtensionKey
=
NULL
,
$selectedTemplateKey
=
NULL
,
$selectedLanguageLeft
=
NULL
,
$selectedLanguageRight
=
NULL
$emailAddress
,
$selectedExtensionKey
,
$selectedTemplateKey
,
$selectedLanguageLeft
)
{
MailTemplateService
::
sendEmail
(
$selectedLanguageLeft
,
$selectedTemplateKey
,
$selectedExtensionKey
,
$emailAddress
,
$this
->
settings
[
'mail'
][
'from'
][
'test'
],
'This is just a Test E-Mail'
,
[],
TRUE
);
MailTemplateService
::
sendEmail
(
$selectedLanguageRight
,
$selectedTemplateKey
,
$selectedExtensionKey
,
$emailAddress
,
$this
->
settings
[
'mail'
][
'from'
][
'test'
],
'This is just a Test E-Mail'
,
[],
TRUE
);
$objectManager
=
GeneralUtility
::
makeInstance
(
ObjectManager
::
class
);
/** @var \SGalinski\SgMail\Service\MailTemplateService $mailTemplateService */
$mailTemplateService
=
$objectManager
->
get
(
MailTemplateService
::
class
);
$mailTemplateService
->
setLanguage
(
$selectedLanguageLeft
);
$mailTemplateService
->
setToAddresses
(
$emailAddress
);
$mailTemplateService
->
setFromAddress
(
$this
->
settings
[
'mail'
][
'test'
][
'from'
]);
$mailTemplateService
->
setSubject
(
$this
->
settings
[
'mail'
][
'test'
][
'subject'
]);
$mailTemplateService
->
setTemplateName
(
$selectedTemplateKey
);
$mailTemplateService
->
setExtensionKey
(
$selectedExtensionKey
);
$mailTemplateService
->
sendEmail
();
$message
=
LocalizationUtility
::
translate
(
'backend.success_mail'
,
'sg_mail'
);
$this
->
addFlashMessage
(
$message
,
''
,
FlashMessage
::
OK
);
...
...
This diff is collapsed.
Click to expand it.
Configuration/TypoScript/setup.ts
+
2
−
1
View file @
0ba2bdc8
...
...
@@ -7,7 +7,8 @@ module.tx_sgmail {
settings
{
mail
{
from
.
test
=
info
@
test
.
de
test
.
from
=
info
@
test
.
de
test
.
subject
=
This
is
just
a
Test
E
-
Mail
}
templateDefaultLanguage
=
en
...
...
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