File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717use Neos \Form \Core \Model \AbstractFinisher ;
1818use Neos \Form \Exception \FinisherException ;
1919use Neos \SwiftMailer \Message as SwiftMailerMessage ;
20+ use Neos \Media \Domain \Model \ResourceBasedInterface ;
2021use Neos \Utility \Arrays ;
2122use Neos \Utility \ObjectAccess ;
2223use Neos \Flow \Annotations as Flow ;
@@ -269,6 +270,9 @@ protected function addAttachments(SwiftMailerMessage $mail)
269270 $ formValues = $ this ->finisherContext ->getFormValues ();
270271 if ($ this ->parseOption ('attachAllPersistentResources ' )) {
271272 foreach ($ formValues as $ formValue ) {
273+ if ($ formValue instanceof ResourceBasedInterface) {
274+ $ formValue = $ formValue ->getResource ();
275+ }
272276 if ($ formValue instanceof PersistentResource) {
273277 $ mail ->attach (new \Swift_Attachment (stream_get_contents ($ formValue ->getStream ()), $ formValue ->getFilename (), $ formValue ->getMediaType ()));
274278 }
You can’t perform that action at this time.
0 commit comments