How to send a zip file by mail ?

Hello,

I've created a zip file in an automation chain and I'd like to send this file by mail. Here's a part of my chain :

File > Get Document File > xpath: file:content
File > Zip > filename: photos.zip
Execution Context > Set Context Variable From Input > name: theZIPFile
Notification > Send E-mail > files: @{Context["theZIPFile"]}

I get this error :

org.nuxeo.ecm.automation.AdapterNotFoundException: No type adapter found for input: class org.nuxeo.ecm.core.api.impl.blob.FileBlob and output class org.nuxeo.ecm.automation.core.util.StringList

Any idea on how to pass the zip file as an attached file to the mail ?

Thank you

Fabrice

0 votes

2 answers

1332 views

ANSWER



Hi,

sorry, I didn't put my exact chain because my problem was to attach the zip file. Here's my complete chain :

Fetch > Context Document(s)
Execution Context > Set Context Variable From Input > name: theDocument
Service > Get Linked Documents
File > Get Document File > xpath: file:content
File > Zip > filename: photos.zip
Execution Context > Set Context Variable From Input > name: theZIPFile
Execution Context > Restore Document Input > name: theDocument
Notification > Send E-mail > files: @{Context["theZIPFile"]}

And so is my problem : “files” seams to look for a stringlist and my context variable “theZIPFile” is a blob. How could I attach the zip file to the mail ?

Thank you very much for your help

Fabrice

0 votes



Hi!

The problem is probably coming from the fact that your operation inputs does not match your outputs. Send Email is waiting for a Document or a Document List. In your operations, your Zip gives you a blob (a file), that is kept by set context variable. So you need a way to give a Document to Send Email.

The solution is to use :

Push & Pop > Push Document

(or Push Document list) before the Get File Operation. It will push the document in a pile in the context. And then, just before the Send Email, use :

 Push & Pop > Pop Document

Push and Pop Operations are operations that enables you to creates piles to temporary save document into the context.

However, I'm surprised that Studio does not tell you about this input/output problem…

Is it better now?

Fred

0 votes