cancel
Showing results for 
Search instead for 
Did you mean: 

Attach file to email

LeonardoALARCON
Confirmed Champ
Confirmed Champ

Hi,

I'm trying to attach the files form a document to an email notification, like this:

<chain id="envoyerMail">
		<operation id="Context.FetchDocument" />
		<operation id="Notification.SendMail">
			<param type="string" name="from">expr:@{WorkflowVariables["expediteur"]}</param>
			<param type="string" name="message">expr:@{WorkflowVariables["message"]}</param>
			<param type="string" name="subject">expr:@{WorkflowVariables["subject"]}</param>
			<param type="stringlist" name="to">expr:@{WorkflowVariables["destinatiares"]}</param>
			<param type="boolean" name="HTML">false</param>
			<param type="stringlist" name="files">expr:@{Document["file:content"]},@{Document["files:files"]}</param>
			<param type="string" name="viewId">view_documents</param>
		</operation>
	</chain>

But I keep getting this error:

2014-07-04 16:49:31,203 ERROR [org.nuxeo.ecm.automation.core.operations.notification.SendMail] Error while fetching blobs: Property not found: org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob@5370ea
2014-07-04 16:49:31,203 ERROR [org.nuxeo.ecm.automation.core.operations.notification.SendMail] Error while fetching blobs: Property not found: [{file=org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob@1a4a35

One error per file.

Does anyone has ever done this?

Thank you.

1 REPLY 1

LeonardoALARCON
Confirmed Champ
Confirmed Champ

I found the solution, the xpath has to be declared as string and not as an expresion:

<chain id="envoyerMail">
		<operation id="Context.FetchDocument"/>
		<operation id="Notification.SendMail">
			<param type="string" name="from">expr:@{WorkflowVariables["expediteur"]}</param>
			<param type="string" name="message">expr:@{WorkflowVariables["message"]}</param>
			<param type="string" name="subject">expr:@{WorkflowVariables["subject"]}</param>
			<param type="stringlist" name="to">expr:@{WorkflowVariables["destinatiares"]}</param>
			<param type="boolean" name="HTML">false</param>
			<param type="stringlist" name="files">file:content,files:files</param>
			<param type="string" name="viewId">view_documents</param>
		</operation>
	</chain>
Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.