Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!19[BUGFIX] Fix broken file reference attachments
......@@ -66,10 +66,6 @@ class FormsFinisher extends AbstractFinisher {
return;
}
if ($formRuntime === NULL) {
return;
}
$markers = [];
$markerLabels = [];
......
......@@ -895,7 +895,16 @@ class MailTemplateService {
$mail->setReplyTo($this->replyToAddress);
foreach ($this->markers as $marker) {
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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment