Skip to content
Snippets Groups Projects
Commit f374cbbb authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Add attached files to the mail queue record

parent f592291e
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/**
......
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