cancel
Showing results for 
Search instead for 
Did you mean: 

Using mail folder to create a reply email message?

karl_harris_
Star Collaborator
Star Collaborator

I have a requirement to implement a reply function using an extended Nuxeo mail folder.

Basically I need to include the Nuxeo stored subject and message body as well as the from/to email addresses in the mailTo mail action when the from field is clicked in the extended mail folder's content view.

Questions:

Since I do not have the standard mail content view when I extended the mail folder: What .xml extensions to I need to provide/override in Studio to get the standard mail content view and add the subject and email body text to the 'reply" email?

Is there a better approach?

Is Java Mail an overkill?

Thanks, in advance for any assistance.

14 REPLIES 14

Alain_ESCAFFRE
Star Contributor
Star Contributor

Hi,

Here is a suggestion of how you could do:

  1. Create a MailResponse Document type (or not, you could simply use in the step after, the MailMessage)

  2. Add a User Action on the Document Summary Actions filtering on MailMessage document type.

  3. In the automation chain bound to the user action,use multiple time "set context variable" to put in the context of the chain the value of the fields that stores the sender and the body of the email you want to reply to,

  4. In the same automation chain,get the parent MailFolder, then use Document > Create to create a document of type MailResponse (orMailMessage). For the properties, use the context variable you computed previously, so that you update the title (with a "Re" prefix string), the recipients and the begining of the body. You can use the Service > Create Relation to create a relation between them at the same time.

  5. In the same automation chain, use UI > Navigate to Document to go to the document type

  6. In the same automatin chain, use UI > Change tab to switch to edit tab. (That's why I think you'd better have your own mail response document type)

  7. Add a user action displayed in the Document edition form category that save and send the email (using the Notification > Send Email operation)

That's is just the idea. I can give a complete solution tomorrow if necessary.

Thanks, I will try this method as soon as I get the extended mail folders working correctly. See my latest posting.

karl_harris_
Star Collaborator
Star Collaborator

Finally got around to trying this. Here are my results so far......

I have a user action which fires the automation chain that seems to work.

When I tried number 3 above I got an error complaining about Null document.

The context of the document does not seem to be available to the automation chain after the I use the Fetch->UI Selected Documents.

I simplified the troubleshooting by trying to just output some of the email fields in a message block to verify the context using User Interface-> Add Info Message with fields like dc:title and mail:sender by using expr:@{Document["mail:sender"]} as the message content. I've also tried #{Document['mail:sender"]} with the same result: I get a blank for the message. If I put a prefix on the output only the prefix prints.

Any suggestions?

I tracked this problem to the Fetch-> UI Selected Documents does not seem to working correctly.

I still cannot get past number 3 on the listing.

A few more pieces to this puzzle.

karl_harris_
Star Collaborator
Star Collaborator

It appears this class(GetSelectedDocuments) is getting a Null value from the DocumentsListManager, yet the ClipBoardActionsBean (called by "Add to worklist" button) seems to be working (non null) with a similar call to DocumentsListManager.

ClipBoardActionsBean fails more gracefully if a null is found.

The GetSelectedDocuments call looks like "almost" the same call except for the OperationsHelper wrapper.

I guess that's where I'll go next....... on to OperationsHelper.

Looks like OperationsHelper gets a SEAM DocumentsListManager from a SEAM utility called Contexts.

After looking at DocumentListManager my guess is

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.