Skip navigation links

Package com.veeva.vault.sdk.api.email

This package provides interfaces to create documents and content based on emails sent to Vault.

See: Description

Package com.veeva.vault.sdk.api.email Description

This package provides interfaces to create documents and content based on emails sent to Vault.

Email Processor

An email processor is a Java class that implements the EmailProcessor interface and has the EmailProcessorInfo annotation.

Email processors take data from emails and convert it into document, object record, or attachment field values and content. Email processors use:

The example below uses the DocumentService to create an Unclassified document from an email and maps values from an EmailItem to document field values. The annotation defines the senders from whom the email processor will accept emails and the label that appears in the Vault Admin UI for the email processor.
 
  @EmailProcessorInfo(allowedSenders = EmailSenderType.VAULT_USERS, label = "Create Unclassified Document")
  public class UnclassifiedEmailProcessor implements EmailProcessor {

   @Override
   public void execute(EmailProcessorContext context) {

                EmailItem emailItem = context.getEmailItem();
                DocumentService documentService = ServiceLocator.locate(DocumentService.class);
                DocumentVersion documentVersion = documentService.newDocument();
                documentVersion.setSourceFile(emailItem.getEmailFile());
                documentVersion.setValue("name__v", emailItem.getSubject());
                documentVersion.setValue("type__v", VaultCollections.asList("undefined__v"));
                documentVersion.setValue("lifecycle__v", VaultCollections.asList("unclassified__v"));
                documentVersion.setValue("status__v", VaultCollections.asList("unclassified__v"));
                documentService.createDocuments(VaultCollections.asList(documentVersion));
    }
 }
 
 
Skip navigation links

Copyright © Veeva Systems 2017–2021. All rights reserved.