Commit f374cbbb authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Add attached files to the mail queue record

parent f592291e
......@@ -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;
}
/**
......
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