Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TYPO3
sg_mail
Commits
f374cbbb
Commit
f374cbbb
authored
May 30, 2018
by
Kevin Ditscheid
Browse files
[BUGFIX] Add attached files to the mail queue record
parent
f592291e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Classes/Service/MailTemplateService.php
View file @
f374cbbb
...
...
@@ -635,11 +635,20 @@ class MailTemplateService {
/**
* Add a file resource as attachment
*
* @param FileInterface $file
* @param FileInterface
|FileReference
$file
* @return MailTemplateService
*/
public
function
addFileResourceAttachment
(
FileInterface
$file
)
{
return
$this
->
addAttachment
(
$file
->
getContents
(),
$file
->
getName
(),
$file
->
getMimeType
());
public
function
addFileResourceAttachment
(
$file
)
{
if
(
$file
instanceof
FileReference
)
{
$this
->
markers
[]
=
$file
;
$file
=
$file
->
getOriginalResource
()
->
getOriginalFile
();
}
elseif
(
$file
instanceof
FileInterface
)
{
$fileReference
=
$this
->
objectManager
->
get
(
FileReference
::
class
);
$fileReference
->
setOriginalResource
(
$file
);
$this
->
markers
[]
=
$fileReference
;
}
$this
->
addAttachment
(
$file
->
getContents
(),
$file
->
getName
(),
$file
->
getMimeType
());
return
$this
;
}
/**
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment