Commit 90b876db authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Fix broken file reference attachments

This commit fixes FileReference attachments of multiple consequtive mails
that are sent via the mail queue, for example via the forms finisher with
a user and an admin mail, where files need to be attached to both mails.
parent cc8ad69f
...@@ -66,10 +66,6 @@ class FormsFinisher extends AbstractFinisher { ...@@ -66,10 +66,6 @@ class FormsFinisher extends AbstractFinisher {
return; return;
} }
if ($formRuntime === NULL) {
return;
}
$markers = []; $markers = [];
$markerLabels = []; $markerLabels = [];
......
...@@ -895,7 +895,16 @@ class MailTemplateService { ...@@ -895,7 +895,16 @@ class MailTemplateService {
$mail->setReplyTo($this->replyToAddress); $mail->setReplyTo($this->replyToAddress);
foreach ($this->markers as $marker) { foreach ($this->markers as $marker) {
if ($marker instanceof FileReference) { if ($marker instanceof FileReference) {
$mail->addAttachment($marker); $coreFileReferenceMailFile = $this->resourceFactory->createFileReferenceObject(
[
'uid_local' => $marker->getOriginalResource()->getOriginalFile()->getUid(),
'table_local' => 'sys_file',
'uid' => uniqid('NEW_MAIL', TRUE)
]
);
$newFileReference = GeneralUtility::makeInstance(FileReference::class);
$newFileReference->setOriginalResource($coreFileReferenceMailFile);
$mail->addAttachment($newFileReference);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment